SourceForge has been redesigned. Learn more.
Close

#127 including glew.h fails with SGI MIPSPro CC

closed
API (59)
5
2012-09-15
2010-04-21
No

Greetings,

including glew.h (V1.5.3) fails with SGI MIPSPro CC compiler
(the C++ compiler) because of an unconditional
-snip-

include <stdint.h>

-snap-

which I propose to guard/change like this:

-snip-

ifndef __cplusplus

#include <stdint.h>

else

#include <inttypes.h>

endif

-snap-

Otherwise CC/stdint.h complain like this:

cc-1035 CC: WARNING File = /usr/include/stdint.h, Line = 5
#error directive: This header file is to be used only for c99 mode
compilations

The proposed change got it working for me.

kind regards,
Randolf

Discussion

  • Nigel Stewart

    Nigel Stewart - 2010-04-25

    Is there some MIPSPro CC compiler-specific #ifdef that could be used, rather than __cplusplus?
    I find it fairly unusual that a C++ compiler would complain about a C99 header file.
    But, each according to their needs...

    • Nigel
     
  • Randolf Schultz

    Randolf Schultz - 2010-04-26

    I agree; one might use "#ifdef __sgi".

    kind regards,
    Randolf

     
  • Nigel Stewart

    Nigel Stewart - 2010-04-26

    Proposed patch:

    Index: auto/src/glew_head.h

    --- auto/src/glew_head.h (revision 595)
    +++ auto/src/glew_head.h (working copy)
    @@ -119,7 +119,12 @@
    */

    #include <stddef.h>
    +
    +#ifdef __sgi
    +#include <inttypes.h>
    +#else
    #include <stdint.h>
    +#endif

    #define GLEW_APIENTRY_DEFINED
    #define APIENTRY

     
  • Nigel Stewart

    Nigel Stewart - 2010-04-27

    Fixed as of revision 597.
    Thanks for the report.

     
  • Nigel Stewart

    Nigel Stewart - 2010-04-28

    Resolved in GLEW 1.5.4 release.
    Thanks for the report.