From aeac221ff6b69201d8808c8d4ab9e89c5ffc5de0 Mon Sep 17 00:00:00 2001 From: theraven Date: Sun, 7 Nov 2010 14:48:21 +0000 Subject: [PATCH] Added defines for __weak and __strong. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@31591 72102866-910b-0410-8b05-ffd578937521 --- Headers/Additions/GNUstepBase/preface.h.in | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Headers/Additions/GNUstepBase/preface.h.in b/Headers/Additions/GNUstepBase/preface.h.in index e1791af16..8e6b1338b 100644 --- a/Headers/Additions/GNUstepBase/preface.h.in +++ b/Headers/Additions/GNUstepBase/preface.h.in @@ -113,6 +113,13 @@ #include #endif +// Include the blocks runtime header if it's available (It shouldn't matter +// that this doesn't work on compilers that don't support __has_include(), +// because they also don't support blocks). +#if __has_include() +# include +#endif + /* * Hack for older compiler versions that don't have all defines * needed in objc-api.h @@ -221,4 +228,12 @@ #include #endif +#if __has_feature(objc_gc) +#define __strong __attribute__((objc_gc(strong))) +#define __weak __attribute__((objc_gc(weak))) +#else +#define __strong +#define __weak +#endif + #endif /* __preface_h_OBJECTS_INCLUDE */