#12 Patch to compile on current OS X (PowerPC)

closed-accepted
nobody
None
5
2008-03-03
2008-03-02
yacht
No

As described in bug #1442615, building on OS X currently fails with "integer constant is too large for 'long' type". (See the bug for a detailed description).

The problem here is that UINT64_C does not get defined by stdint.h. This (and similar) macros are defined by stdint.h if the preprocessor symbol __STDC_CONSTANT_MACROS is defined upon inclusion. However, _subconf.h includes assert.h before defining these preprocessor symbols, which apparently causes stdint.h to be included indirectly. This means that by the time _subconf.h includes stdint.h after defining those symbols, they do not have any effect because stdint.h protects itself against multiple inclusion.

The solution here is to move the definition of the preprocessor symbols __STDC_CONSTANT_MACROS (and similar) to the top of _subconf.h, at least before assert.h or any other standard library headers get included. The attached patch to _subconf.h achieves this and should not have any other side-effects.

Discussion

  • yacht
    yacht
    2008-03-02

    Patch to subconf.h to move definition of __STDC* macros before inclusion of any standard headers

     
    Attachments
  • Logged In: YES
    user_id=65253
    Originator: NO

    Thank you for the patch, it's been applied to CVS.

     
    • status: open --> closed-accepted