mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 00:41:02 +00:00
Fix for exception handling with libobjc2
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@29247 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
2c28fd3e4c
commit
25ad93b2f7
7 changed files with 7915 additions and 7916 deletions
12
ChangeLog
12
ChangeLog
|
@ -1,3 +1,15 @@
|
|||
2010-01-09 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* configure.ac:
|
||||
* Source/NSException.m:
|
||||
* Headers/Additions/GNUstepBase/config.h.in:
|
||||
* config/config.unexpected.m:
|
||||
* config/config.set_unexpected.m:
|
||||
* configure:
|
||||
Modified to suppport native exceptions with libobjc2 which is missing
|
||||
the objc_set_unexpected() function and just uses direct assignment of
|
||||
a function pointer.
|
||||
|
||||
2010-01-05 Eric Wasylishen <ewasylishen@gmail.com>
|
||||
|
||||
* Headers/Foundation/NSCharacterSet.h
|
||||
|
|
|
@ -166,6 +166,9 @@
|
|||
/* Define to 1 if you have the `nsl' library (-lnsl). */
|
||||
#undef HAVE_LIBNSL
|
||||
|
||||
/* Define to 1 if you have the `rt' library (-lrt). */
|
||||
#undef HAVE_LIBRT
|
||||
|
||||
/* Define if libxml available */
|
||||
#undef HAVE_LIBXML
|
||||
|
||||
|
@ -283,6 +286,9 @@
|
|||
/* Define to 1 if you have the `setrlimit' function. */
|
||||
#undef HAVE_SETRLIMIT
|
||||
|
||||
/* Define if libobjc has the objc_set_unexpected() function */
|
||||
#undef HAVE_SET_UNEXPECTED
|
||||
|
||||
/* Define to 1 if you have the `shmctl' function. */
|
||||
#undef HAVE_SHMCTL
|
||||
|
||||
|
@ -429,7 +435,7 @@
|
|||
/* Define to 1 if the system has the type `uintmax_t'. */
|
||||
#undef HAVE_UINTMAX_T
|
||||
|
||||
/* Define if libobjc has the objc_set_unexpected() function */
|
||||
/* Define if libobjc has the _objc_unexpected_exception callback */
|
||||
#undef HAVE_UNEXPECTED
|
||||
|
||||
/* Define to 1 if you have the <unistd.h> header file. */
|
||||
|
@ -489,31 +495,31 @@
|
|||
/* Define to 1 if the `setpgrp' function takes no argument. */
|
||||
#undef SETPGRP_VOID
|
||||
|
||||
/* The size of `double', as computed by sizeof. */
|
||||
/* The size of a `double', as computed by sizeof. */
|
||||
#undef SIZEOF_DOUBLE
|
||||
|
||||
/* The size of `float', as computed by sizeof. */
|
||||
/* The size of a `float', as computed by sizeof. */
|
||||
#undef SIZEOF_FLOAT
|
||||
|
||||
/* The size of `int', as computed by sizeof. */
|
||||
/* The size of a `int', as computed by sizeof. */
|
||||
#undef SIZEOF_INT
|
||||
|
||||
/* The size of `long', as computed by sizeof. */
|
||||
/* The size of a `long', as computed by sizeof. */
|
||||
#undef SIZEOF_LONG
|
||||
|
||||
/* The size of `long long', as computed by sizeof. */
|
||||
/* The size of a `long long', as computed by sizeof. */
|
||||
#undef SIZEOF_LONG_LONG
|
||||
|
||||
/* The size of `pthread_cond_t', as computed by sizeof. */
|
||||
/* The size of a `pthread_cond_t', as computed by sizeof. */
|
||||
#undef SIZEOF_PTHREAD_COND_T
|
||||
|
||||
/* The size of `pthread_mutex_t', as computed by sizeof. */
|
||||
/* The size of a `pthread_mutex_t', as computed by sizeof. */
|
||||
#undef SIZEOF_PTHREAD_MUTEX_T
|
||||
|
||||
/* The size of `short', as computed by sizeof. */
|
||||
/* The size of a `short', as computed by sizeof. */
|
||||
#undef SIZEOF_SHORT
|
||||
|
||||
/* The size of `void*', as computed by sizeof. */
|
||||
/* The size of a `void*', as computed by sizeof. */
|
||||
#undef SIZEOF_VOIDP
|
||||
|
||||
/* Define to 1 if you have the ANSI C header files. */
|
||||
|
@ -531,13 +537,9 @@
|
|||
/* Define if vsprintf returns the length printed */
|
||||
#undef VSPRINTF_RETURNS_LENGTH
|
||||
|
||||
/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
|
||||
significant byte first (like Motorola and SPARC, unlike Intel and VAX). */
|
||||
#if defined __BIG_ENDIAN__
|
||||
# define WORDS_BIGENDIAN 1
|
||||
#elif ! defined __LITTLE_ENDIAN__
|
||||
# undef WORDS_BIGENDIAN
|
||||
#endif
|
||||
/* Define to 1 if your processor stores words with the most significant byte
|
||||
first (like Motorola and SPARC, unlike Intel and VAX). */
|
||||
#undef WORDS_BIGENDIAN
|
||||
|
||||
/* Define to `__inline__' or `__inline' if that's what the C compiler
|
||||
calls it, or to nothing if 'inline' is not supported under any name. */
|
||||
|
@ -545,5 +547,5 @@
|
|||
#undef inline
|
||||
#endif
|
||||
|
||||
/* Define to `unsigned int' if <sys/types.h> does not define. */
|
||||
/* Define to `unsigned' if <sys/types.h> does not define. */
|
||||
#undef size_t
|
||||
|
|
|
@ -238,8 +238,13 @@ callUncaughtHandler(id value)
|
|||
|
||||
+ (void) initialize
|
||||
{
|
||||
#if defined(_NATIVE_OBJC_EXCEPTIONS) && defined(HAVE_UNEXPECTED)
|
||||
#if defined(_NATIVE_OBJC_EXCEPTIONS)
|
||||
# if defined(HAVE_UNEXPECTED)
|
||||
_objc_unexpected_exception = callUncaughtHandler;
|
||||
# endif
|
||||
# if defined(HAVE_SET_UNEXPECTED)
|
||||
objc_set_unexpected(callUncaughtHandler);
|
||||
# endif
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
|
7
config/config.set_unexpected.m
Normal file
7
config/config.set_unexpected.m
Normal file
|
@ -0,0 +1,7 @@
|
|||
#include <objc/objc-api.h>
|
||||
|
||||
int main (void)
|
||||
{
|
||||
objc_set_unexpected(0);
|
||||
return 0;
|
||||
}
|
|
@ -2,6 +2,6 @@
|
|||
|
||||
int main (void)
|
||||
{
|
||||
objc_set_unexpected(0);
|
||||
_objc_unexpected_exception = 0;
|
||||
return 0;
|
||||
}
|
||||
|
|
13
configure.ac
13
configure.ac
|
@ -681,14 +681,23 @@ AC_EGREP_HEADER(objc_get_uninstalled_dtable, objc/objc-api.h,
|
|||
# Don't revert any Objective-C flags as they are used in the next test
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
# This function needed by for handling uncaught exceptions
|
||||
# One of these is needed by for handling uncaught exceptions
|
||||
#--------------------------------------------------------------------
|
||||
AC_MSG_CHECKING(for objc_set_unexpected() in runtime)
|
||||
AC_LINK_IFELSE([#include "$srcdir/config/config.set_unexpected.m"],
|
||||
have_set_unexpected=yes, have_set_unexpected=no)
|
||||
if test $have_set_unexpected = yes; then
|
||||
AC_DEFINE(HAVE_SET_UNEXPECTED,1,
|
||||
[Define if libobjc has the objc_set_unexpected() function])
|
||||
fi
|
||||
AC_MSG_RESULT($have_set_unexpected)
|
||||
|
||||
AC_MSG_CHECKING(for _objc_unexpected_exception in runtime)
|
||||
AC_LINK_IFELSE([#include "$srcdir/config/config.unexpected.m"],
|
||||
have_unexpected=yes, have_unexpected=no)
|
||||
if test $have_unexpected = yes; then
|
||||
AC_DEFINE(HAVE_UNEXPECTED,1,
|
||||
[Define if libobjc has the objc_set_unexpected() function])
|
||||
[Define if libobjc has the _objc_unexpected_exception callback])
|
||||
fi
|
||||
AC_MSG_RESULT($have_unexpected)
|
||||
|
||||
|
|
Loading…
Reference in a new issue