Merge branch 'master' of ssh://github.com/gnustep/libs-base

Conflicts:
	ChangeLog
This commit is contained in:
Richard Frith-Macdonald 2017-12-21 13:56:34 +00:00
commit 6ec34b4df4
2 changed files with 35 additions and 5 deletions

View file

@ -16,6 +16,16 @@
the loop must be run inside an exception handler which makes sure to the loop must be run inside an exception handler which makes sure to
remove the handle from the loop before re-raising the exception. remove the handle from the loop before re-raising the exception.
2017-12-21 Riccardo Mottola <rm@gnu.org>
* Source/NSObject.m:
Cleanup previous commit.
2017-12-21 Riccardo Mottola <rm@gnu.org>
* Source/NSObject.m:
Compatibility for OS/compiler not supporting weak symbols.
2017-12-20 Richard Frith-Macdonald <rfm@gnu.org> 2017-12-20 Richard Frith-Macdonald <rfm@gnu.org>
* configure.ac: Remove obsolete --enable-objc-nonfragile-abi flag * configure.ac: Remove obsolete --enable-objc-nonfragile-abi flag

View file

@ -1,5 +1,5 @@
/** Implementation of NSObject for GNUStep /** Implementation of NSObject for GNUStep
Copyright (C) 1994-2010 Free Software Foundation, Inc. Copyright (C) 1994-2017 Free Software Foundation, Inc.
Written by: Andrew Kachites McCallum <mccallum@gnu.ai.mit.edu> Written by: Andrew Kachites McCallum <mccallum@gnu.ai.mit.edu>
Date: August 1994 Date: August 1994
@ -77,6 +77,17 @@
#endif #endif
#endif #endif
/* platforms which do not support weak */
#if (__GNUC__ == 3) && defined (__WIN32)
#define WEAK_ATTRIBUTE
#undef SUPPORT_WEAK
#else
/* all platforms which support weak */
#define WEAK_ATTRIBUTE __attribute__((weak))
#define SUPPORT_WEAK 1
#endif
/* When this is `YES', every call to release/autorelease, checks to /* When this is `YES', every call to release/autorelease, checks to
make sure isn't being set up to release itself too many times. make sure isn't being set up to release itself too many times.
This does not need mutex protection. */ This does not need mutex protection. */
@ -451,18 +462,19 @@ typedef struct obj_layout *obj;
* runtime. When linked against an older version, we will use our internal * runtime. When linked against an older version, we will use our internal
* versions. * versions.
*/ */
__attribute__((weak)) WEAK_ATTRIBUTE
BOOL objc_release_fast_no_destroy_np(id anObject); BOOL objc_release_fast_no_destroy_np(id anObject);
__attribute__((weak)) WEAK_ATTRIBUTE
void objc_release_fast_np(id anObject); void objc_release_fast_np(id anObject);
__attribute__((weak)) WEAK_ATTRIBUTE
size_t object_getRetainCount_np(id anObject); size_t object_getRetainCount_np(id anObject);
__attribute__((weak)) WEAK_ATTRIBUTE
id objc_retain_fast_np(id anObject); id objc_retain_fast_np(id anObject);
static BOOL objc_release_fast_no_destroy_internal(id anObject) static BOOL objc_release_fast_no_destroy_internal(id anObject)
{ {
if (double_release_check_enabled) if (double_release_check_enabled)
@ -524,11 +536,13 @@ static BOOL objc_release_fast_no_destroy_internal(id anObject)
static BOOL release_fast_no_destroy(id anObject) static BOOL release_fast_no_destroy(id anObject)
{ {
#ifdef SUPPORT_WEAK
if (objc_release_fast_no_destroy_np) if (objc_release_fast_no_destroy_np)
{ {
return objc_release_fast_no_destroy_np(anObject); return objc_release_fast_no_destroy_np(anObject);
} }
else else
#endif
{ {
return objc_release_fast_no_destroy_internal(anObject); return objc_release_fast_no_destroy_internal(anObject);
} }
@ -544,11 +558,13 @@ static void objc_release_fast_np_internal(id anObject)
static void release_fast(id anObject) static void release_fast(id anObject)
{ {
#ifdef SUPPORT_WEAK
if (objc_release_fast_np) if (objc_release_fast_np)
{ {
objc_release_fast_np(anObject); objc_release_fast_np(anObject);
} }
else else
#endif
{ {
objc_release_fast_np_internal(anObject); objc_release_fast_np_internal(anObject);
} }
@ -573,11 +589,13 @@ size_t object_getRetainCount_np_internal(id anObject)
size_t getRetainCount(id anObject) size_t getRetainCount(id anObject)
{ {
#ifdef SUPPORT_WEAK
if (object_getRetainCount_np) if (object_getRetainCount_np)
{ {
return object_getRetainCount_np(anObject); return object_getRetainCount_np(anObject);
} }
else else
#endif
{ {
return object_getRetainCount_np_internal(anObject); return object_getRetainCount_np_internal(anObject);
} }
@ -668,11 +686,13 @@ static id objc_retain_fast_np_internal(id anObject)
static id retain_fast(id anObject) static id retain_fast(id anObject)
{ {
#ifdef SUPPORT_WEAK
if (objc_retain_fast_np) if (objc_retain_fast_np)
{ {
return objc_retain_fast_np(anObject); return objc_retain_fast_np(anObject);
} }
else else
#endif
{ {
return objc_retain_fast_np_internal(anObject); return objc_retain_fast_np_internal(anObject);
} }