From 06e3db262b997c7ed8879da0349d02c91902194f Mon Sep 17 00:00:00 2001 From: rfm Date: Mon, 22 Jun 2015 09:33:37 +0000 Subject: [PATCH] minor tweaks for Yosemite git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@38667 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 7 +++++++ Headers/GNUstepBase/Additions.h | 3 +++ Headers/GNUstepBase/GSConfig.h.in | 19 +++++++++++++------ Headers/GNUstepBase/GSVersionMacros.h | 8 ++++++++ 4 files changed, 31 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index e0318d023..db2c66659 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2015-06-22 Richard Frith-Macdonald + + * Headers/GNUstepBase/Additions.h: + * Headers/GNUstepBase/GSConfig.h.in: + * Headers/GNUstepBase/GSVersionMacros.h: + Minor tweaks to build and avoid warnings in Yosemite + 2015-06-14 Riccardo Mottola * Headers/Foundation/NSData.h diff --git a/Headers/GNUstepBase/Additions.h b/Headers/GNUstepBase/Additions.h index d606b6ee8..c22bd42fb 100644 --- a/Headers/GNUstepBase/Additions.h +++ b/Headers/GNUstepBase/Additions.h @@ -30,7 +30,10 @@ #import #import + +#if !(defined(NeXT_RUNTIME) || defined(Apple_RUNTIME)) #import +#endif #import #import #import diff --git a/Headers/GNUstepBase/GSConfig.h.in b/Headers/GNUstepBase/GSConfig.h.in index 698aadc1e..885ceb04a 100644 --- a/Headers/GNUstepBase/GSConfig.h.in +++ b/Headers/GNUstepBase/GSConfig.h.in @@ -409,12 +409,19 @@ typedef struct { #endif #if !__has_feature(objc_arc) -# if __OBJC_GC__ -# define __strong __attribute__((objc_gc(strong))) -# define __weak __attribute__((objc_gc(weak))) -# else -# define __strong -# define __weak +# if !defined(__weak) +# if __OBJC_GC__ +# define __weak __attribute__((objc_gc(weak))) +# else +# define __weak +# endif +# endif +# if !defined(__strong) +# if __OBJC_GC__ +# define __strong __attribute__((objc_gc(strong))) +# else +# define __strong +# endif # endif #endif diff --git a/Headers/GNUstepBase/GSVersionMacros.h b/Headers/GNUstepBase/GSVersionMacros.h index 620de82e5..99666acd0 100644 --- a/Headers/GNUstepBase/GSVersionMacros.h +++ b/Headers/GNUstepBase/GSVersionMacros.h @@ -406,27 +406,35 @@ static inline void gs_consumed(id NS_CONSUMED GS_UNUSED_ARG o) { return; } /* Attribute macros compatible with Apple. */ +#ifndef NS_FORMAT_ARGUMENT #if defined(__clang__) || GS_GCC_MINREQ(4,2) # define NS_FORMAT_ARGUMENT(A) __attribute__((format_arg(A))) #else # define NS_FORMAT_ARGUMENT(F,A) #endif +#endif // FIXME ... what version of gcc? +#ifndef NS_FORMAT_FUNCTION #if __clang__ # define NS_FORMAT_FUNCTION(F,A) __attribute__((format(__NSString__, F, A))) #else # define NS_FORMAT_FUNCTION(F,A) #endif +#endif +#ifndef NS_REQUIRES_NIL_TERMINATION #define NS_REQUIRES_NIL_TERMINATION __attribute__((sentinel)) +#endif // FIXME ... what exact version of clang and gcc? +#ifndef UNAVAILABLE_ATTRIBUTE #if defined(__clang__) || GS_GCC_MINREQ(4,0) # define UNAVAILABLE_ATTRIBUTE __attribute__((unavailable)) #else # define UNAVAILABLE_ATTRIBUTE #endif +#endif /* Check if compiler supports @optional in protocols */