Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#127 including glew.h fails with SGI MIPSPro CC

closed
Nigel Stewart
API (59)
5
2012-09-15
2010-04-21
Randolf Schultz
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
     
  • 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

     


Anonymous


Cancel   Add attachments