Bug 62001

Summary: HAVE_STDBOOL_H not being defined appropriately on OS X
Product: p11-glue Reporter: Jack Nagel <jacknagel>
Component: p11-kitAssignee: Stef Walter <stefw>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: medium CC: stefw
Version: unspecified   
Hardware: Other   
OS: Mac OS X (All)   
Whiteboard:
i915 platform: i915 features:
Attachments: Properly detect the stdbool.h header

Description Jack Nagel 2013-03-08 04:36:09 UTC
Trying to compile v0.16.1 on Mac OS X 10.6.8, I see:

Making all in .
  CC       compat.lo
In file included from compat.c:37:
./compat.h:252:16: error: expected '}'
typedef enum { false, true } bool;
               ^
/usr/bin/../lib/clang/3.0/include/stdbool.h:33:15: note: instantiated from:
#define false 0
              ^
./compat.h:252:14: note: to match this '{'
typedef enum { false, true } bool;
             ^
./compat.h:252:30: error: cannot combine with previous 'enum' declaration specifier
typedef enum { false, true } bool;
                             ^
/usr/bin/../lib/clang/3.0/include/stdbool.h:31:14: note: instantiated from:
#define bool _Bool
             ^
In file included from compat.c:37:
./compat.h:252:1: warning: typedef requires a name [-Wmissing-declarations]
typedef enum { false, true } bool;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning and 2 errors generated.


So it appears that HAVE_STDBOOL_H is not being defined appropriately; I get identical errors using gcc instead of clang. (clang has an internal stdbool.h but there is also a stdbool.h in /usr/include).
Comment 1 Stef Walter 2013-03-08 07:50:16 UTC
Created attachment 76146 [details] [review]
Properly detect the stdbool.h header
Comment 2 Stef Walter 2013-03-08 07:54:16 UTC
Could you test the attach patch and see if it solves the problem? If not, could you produce a patch which does? I don't have access to a Mac OS X machine currently, although I'm willing to accommodate proprietary OS's if a patch is provided.
Comment 3 Jack Nagel 2013-03-08 21:20:31 UTC
It does, thanks!

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.