Make base do unintuitive and stupid things in the name of Apple compatibility (hopefully Apple will fix their implementation in 10.7.something...).

Fix some tests.



git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33687 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
theraven 2011-08-03 09:04:12 +00:00
parent 3104649bc8
commit a04ed1a9ff
6 changed files with 34 additions and 76 deletions

View file

@ -40,8 +40,15 @@
# define STRONG_ACQUIRE(x) x
#elif defined(OBJC_CAP_ARC)
# include <objc/objc-arc.h>
/*
* OS X 10.7 uses weak to mean unsafe unretained, which is stupid and wrong,
* but we should probably do the same thing for now. Uncomment this when Apple
* fixes their implementation.
# define WEAK_READ(x) objc_loadWeak((id*)x)
# define WEAK_WRITE(addr, x) objc_storeWeak((id*)addr, (id)x)
*/
# define WEAK_READ(x) (*x)
# define WEAK_WRITE(addr, x) (*(addr) = x)
# define STRONG_WRITE(addr, x) objc_storeStrong((id*)addr, (id)x)
# define STRONG_ACQUIRE(x) objc_retain(x)
#else