mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-25 01:31:08 +00:00
Tweak the exception mismatch handling so that if base is using native
exceptions and the user doesn't specify an exception mode then we just don't define the NS_ macros, so code that uses @try etc. compiles without requiring every cc line to specify a long -D flag just to be allowed to #import Foundation.h. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@34501 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
e22b69e37a
commit
9e2747ae90
1 changed files with 3 additions and 5 deletions
|
@ -35,12 +35,10 @@
|
||||||
|
|
||||||
#if defined(_NATIVE_OBJC_EXCEPTIONS)
|
#if defined(_NATIVE_OBJC_EXCEPTIONS)
|
||||||
#define USER_NATIVE_OBJC_EXCEPTIONS 1
|
#define USER_NATIVE_OBJC_EXCEPTIONS 1
|
||||||
#elif __has_feature(objc_exceptions)
|
|
||||||
#define USER_NATIVE_OBJC_EXCEPTIONS 1
|
|
||||||
#else
|
#else
|
||||||
#define USER_NATIVE_OBJC_EXCEPTIONS 0
|
#define USER_NATIVE_OBJC_EXCEPTIONS 0
|
||||||
#endif
|
#endif
|
||||||
#if BASE_NATIVE_OBJC_EXCEPTIONS != USER_NATIVE_OBJC_EXCEPTIONS
|
#if !BASE_NATIVE_OBJC_EXCEPTIONS && USER_NATIVE_OBJC_EXCEPTIONS
|
||||||
#error The current setting for native-objc-exceptions does not match that of gnustep-base ... please correct this.
|
#error The current setting for native-objc-exceptions does not match that of gnustep-base ... please correct this.
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -330,7 +328,7 @@ NSSetUncaughtExceptionHandler(NSUncaughtExceptionHandler *handler);
|
||||||
It is illegal to exit the first block of code by any other means than
|
It is illegal to exit the first block of code by any other means than
|
||||||
NS_VALRETURN, NS_VOIDRETURN, or just falling out the bottom.
|
NS_VALRETURN, NS_VOIDRETURN, or just falling out the bottom.
|
||||||
*/
|
*/
|
||||||
#if defined(_NATIVE_OBJC_EXCEPTIONS)
|
#if USER_NATIVE_OBJC_EXCEPTIONS
|
||||||
|
|
||||||
# define NS_DURING @try {
|
# define NS_DURING @try {
|
||||||
# define NS_HANDLER } @catch (NSException * localException) {
|
# define NS_HANDLER } @catch (NSException * localException) {
|
||||||
|
@ -340,7 +338,7 @@ NSSetUncaughtExceptionHandler(NSUncaughtExceptionHandler *handler);
|
||||||
# define NS_VALUERETURN(object, id) return (object)
|
# define NS_VALUERETURN(object, id) return (object)
|
||||||
# define NS_VOIDRETURN return
|
# define NS_VOIDRETURN return
|
||||||
|
|
||||||
#else // _NATIVE_OBJC_EXCEPTIONS
|
#elif !USER_NATIVE_OBJC_EXCEPTIONS && !BASE_NATIVE_OBJC_EXCEPTIONS
|
||||||
|
|
||||||
/** Private support routine. Do not call directly. */
|
/** Private support routine. Do not call directly. */
|
||||||
GS_EXPORT void _NSAddHandler( NSHandler *handler );
|
GS_EXPORT void _NSAddHandler( NSHandler *handler );
|
||||||
|
|
Loading…
Reference in a new issue