Fixed bug 2694 - configure bug __has_feature macro not detected
authorSam Lantinga <slouken@libsdl.org>
Tue, 19 Aug 2014 21:17:21 -0700
changeset 909465a23b7b43c7
parent 9093 61d1cd95698e
child 9095 ed277c1c9e7f
Fixed bug 2694 - configure bug __has_feature macro not detected

skaller

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.
include/SDL_syswm.h
     1.1 --- a/include/SDL_syswm.h	Tue Aug 19 21:13:07 2014 -0700
     1.2 +++ b/include/SDL_syswm.h	Tue Aug 19 21:17:21 2014 -0700
     1.3 @@ -208,7 +208,7 @@
     1.4  #if defined(SDL_VIDEO_DRIVER_COCOA)
     1.5          struct
     1.6          {
     1.7 -#if defined(__OBJC__) && __has_feature(objc_arc)
     1.8 +#if defined(__OBJC__) && defined(__clang__) && __has_feature(objc_arc)
     1.9              NSWindow __unsafe_unretained *window; /* The Cocoa window */
    1.10  #else
    1.11              NSWindow *window;                     /* The Cocoa window */
    1.12 @@ -218,7 +218,7 @@
    1.13  #if defined(SDL_VIDEO_DRIVER_UIKIT)
    1.14          struct
    1.15          {
    1.16 -#if defined(__OBJC__) && __has_feature(objc_arc)
    1.17 +#if defined(__OBJC__) && defined(__clang__) && __has_feature(objc_arc)
    1.18              UIWindow __unsafe_unretained *window; /* The UIKit window */
    1.19  #else
    1.20              UIWindow *window;                     /* The UIKit window */