From a1c91f4695e208d5a8f80dc37b1818169b7829ff Mon Sep 17 00:00:00 2001 From: Daniel Wilhelm Date: Fri, 18 Apr 2014 17:24:59 +0200 Subject: 5.17 --- zen/osx_throw_exception.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'zen/osx_throw_exception.h') 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 -#include -#include +#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(msg)); + throw zen::SysError(zen::utfCvrtTo(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 -- cgit