[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: warnings in ProjectCenter and GNUstep detect
From: |
David Chisnall |
Subject: |
Re: warnings in ProjectCenter and GNUstep detect |
Date: |
Thu, 7 Apr 2011 11:11:59 +0100 |
__APPLE__ is defined (and set to 1) by Apple GCC and by clang on OS X.
Note that this will still break for people trying to use GNUstep on OS X. With
clang, you can also use the __has_include() pseudo-macro, like this:
#ifndef __has_include
# define __has_include(x) 0
#end
#if __has_include(<GNUstepBase/Additions.h>)
# import <GNUstepBase/Additions.h>
#endif
This will include Additions.h if it exists, but not present an error if it
doesn't.
This might be slightly better, since I doubt anyone will be using gcc on OS X
for much longer.
David
On 7 Apr 2011, at 11:03, Riccardo Mottola wrote:
> Hi,
>
> I wondered about some warnings in ProjectCenter and found out that they are
> derived from the redefinition of some typical defines and macros in an macos
> comaptibility list of defines.
>
> Headers/ProjectCenter/PCDefines.h
>
> Currently that section is enabled by:
>
> #ifndef GNUSTEP_BASE_VERSION
>
> but since no additional headers are imported before, this will clearly fail
> since the section will be always enabled even on gnustep.
>
> Currently the gnustep base version is defined in the additions, but it does
> not make sense to import it if it is not required on mac, making the usage
> circular.
>
> Is there a define which exists on mac and/or gnustep without importing
> anything?
>
> Or, if not, by importing a header of plain Foundation?
>
> Riccardo
>
> _______________________________________________
> Discuss-gnustep mailing list
> Discuss-gnustep@gnu.org
> http://lists.gnu.org/mailman/listinfo/discuss-gnustep
-- Sent from my brain