We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 2694 - configure bug __has_feature macro not detected
Summary: configure bug __has_feature macro not detected
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: build (show other bugs)
Version: HG 2.1
Hardware: x86 Mac OS X 10.6
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-08-20 03:32 UTC by skaller
Modified: 2014-08-20 05:06 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description skaller 2014-08-20 03:32:14 UTC
using gcc 4.2 (the default) on Mac OSX 10.6.8

 CC     build/SDL_dynapi.lo
In file included from /Users/johnskaller/SDL/src/dynapi/SDL_dynapi.c:31:
include/SDL_syswm.h:211:39: error: missing binary operator before token "("

The fault appears to be here:

#if defined(__OBJC__) && __has_feature(objc_arc)

that the __has_feature macro is not supported by gcc 4.2.

The code works fine with my clang 3.3svn. 

Gcc cannot be upgraded on OSX. Therefore:

Either the configure script should check for clang on OSX
and use that as the default, or this macro must be configured
out (since it can't be supported by any gcc on OSX).
Comment 1 Sam Lantinga 2014-08-20 04:17:56 UTC
Can you check to see if this fixes it?
https://hg.libsdl.org/SDL/rev/65a23b7b43c7

Thanks!
Comment 2 Alex Szpakowski 2014-08-20 05:01:08 UTC
I think a more robust way would be to check whether '__has_feature' is defined, rather than just checking which compiler was used.
Comment 3 Sam Lantinga 2014-08-20 05:04:03 UTC
Is it a simple macro? I agree that would be a better fix if we can simply do && defined(__has_feature)
Comment 4 Sam Lantinga 2014-08-20 05:05:37 UTC
Yeah, that totally works, thanks! :)
https://hg.libsdl.org/SDL/rev/5bbfdfa38bfc
Comment 5 Alex Szpakowski 2014-08-20 05:06:40 UTC
Yeah, it's listed as a macro here http://clang.llvm.org/docs/LanguageExtensions.html#feature-checking-macros , and Xcode sees it as a macro too.