diff options
Diffstat (limited to 'zen/osx_throw_exception.h')
-rw-r--r-- | zen/osx_throw_exception.h | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/zen/osx_throw_exception.h b/zen/osx_throw_exception.h index 31592854..018e9456 100644 --- a/zen/osx_throw_exception.h +++ b/zen/osx_throw_exception.h @@ -8,21 +8,21 @@ #define OSX_EXCEPTION_89274305834255 #import <Cocoa/Cocoa.h> -#include <zen/osx_error.h> -#include <zen/utf.h> +#include "sys_error.h" +#include "utf.h" namespace osx { //for use in Objective C implementation files only! -void throwOsxError(NSException* e); //throw OsxError +void throwSysError(NSException* e); //throw SysError -#define ZEN_OSX_ASSERT(obj) ZEN_OSX_ASSERT_IMPL(obj, #obj) //throw OsxError +#define ZEN_OSX_ASSERT(obj) ZEN_OSX_ASSERT_IMPL(obj, #obj) //throw SysError /* -Example: ZEN_COM_ASSERT(obj); +Example: ZEN_OSX_ASSERT(obj); Equivalent to: if (!obj) - throw OsxError(L"Assertion failed: \"obj\"."); + throw zen::SysError(L"Assertion failed: \"obj\"."); */ @@ -32,7 +32,7 @@ Equivalent to: //######################## implmentation ############################ inline -void throwOsxError(NSException* e) //throw OsxError +void throwSysError(NSException* e) //throw SysError { std::string msg; if (const char* name = [[e name ] cStringUsingEncoding:NSUTF8StringEncoding]) //"const char*" NOT owned by us! @@ -42,7 +42,7 @@ if (const char* descr = [[e reason] cStringUsingEncoding:NSUTF8StringEncoding]) msg += "\n"; msg += descr; } - throw OsxError(zen::utfCvrtTo<std::wstring>(msg)); + throw zen::SysError(zen::utfCvrtTo<std::wstring>(msg)); /* e.g. NSInvalidArgumentException @@ -51,6 +51,6 @@ if (const char* descr = [[e reason] cStringUsingEncoding:NSUTF8StringEncoding]) } } -#define ZEN_OSX_ASSERT_IMPL(obj, txt) if (!(obj)) throw osx::OsxError(std::wstring(L"Assertion failed: \"") + L ## txt + L"\"."); +#define ZEN_OSX_ASSERT_IMPL(obj, txt) if (!(obj)) throw zen::SysError(std::wstring(L"Assertion failed: \"") + L ## txt + L"\"."); #endif //OSX_EXCEPTION_89274305834255 |