mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-29 16:01:38 +00:00
Merge branch 'master' of ssh://github.com/gnustep/libs-base
Conflicts: ChangeLog
This commit is contained in:
commit
6ec34b4df4
2 changed files with 35 additions and 5 deletions
|
@ -1,5 +1,5 @@
|
|||
/** 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>
|
||||
Date: August 1994
|
||||
|
@ -77,6 +77,17 @@
|
|||
#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
|
||||
make sure isn't being set up to release itself too many times.
|
||||
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
|
||||
* versions.
|
||||
*/
|
||||
__attribute__((weak))
|
||||
WEAK_ATTRIBUTE
|
||||
BOOL objc_release_fast_no_destroy_np(id anObject);
|
||||
|
||||
__attribute__((weak))
|
||||
WEAK_ATTRIBUTE
|
||||
void objc_release_fast_np(id anObject);
|
||||
|
||||
__attribute__((weak))
|
||||
WEAK_ATTRIBUTE
|
||||
size_t object_getRetainCount_np(id anObject);
|
||||
|
||||
__attribute__((weak))
|
||||
WEAK_ATTRIBUTE
|
||||
id objc_retain_fast_np(id anObject);
|
||||
|
||||
|
||||
static BOOL objc_release_fast_no_destroy_internal(id anObject)
|
||||
{
|
||||
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)
|
||||
{
|
||||
#ifdef SUPPORT_WEAK
|
||||
if (objc_release_fast_no_destroy_np)
|
||||
{
|
||||
return objc_release_fast_no_destroy_np(anObject);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
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)
|
||||
{
|
||||
#ifdef SUPPORT_WEAK
|
||||
if (objc_release_fast_np)
|
||||
{
|
||||
objc_release_fast_np(anObject);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
objc_release_fast_np_internal(anObject);
|
||||
}
|
||||
|
@ -573,11 +589,13 @@ size_t object_getRetainCount_np_internal(id anObject)
|
|||
|
||||
size_t getRetainCount(id anObject)
|
||||
{
|
||||
#ifdef SUPPORT_WEAK
|
||||
if (object_getRetainCount_np)
|
||||
{
|
||||
return object_getRetainCount_np(anObject);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
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)
|
||||
{
|
||||
#ifdef SUPPORT_WEAK
|
||||
if (objc_retain_fast_np)
|
||||
{
|
||||
return objc_retain_fast_np(anObject);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
return objc_retain_fast_np_internal(anObject);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue