Ancurio / mkxp

Free Software implementation of the Ruby Game Scripting System (RGSS)
GNU General Public License v2.0
514 stars 131 forks source link

conflicting typedefs with SDL_opengl.h #80

Closed hanetzer closed 9 years ago

hanetzer commented 9 years ago

Small issue I ran into; I temporarily commented out the offending lines while working on #79 to get a working build chain but I believe I should mention it here. Occurs whether using my home-made autotools chain, cmake, or qmake, so the issue is outside of the build process. Maybe there is some bad config on my system.

In file included from src/debuglogger.cpp:27:0:
src/gl-fun.h:72:129: error: conflicting declaration ‘typedef void (* PFNGLSHADERSOURCEPROC)(GLuint, GLsizei, const GLchar* const*, const GLint*)’
 typedef void (APIENTRYP PFNGLSHADERSOURCEPROC) (GLuint shader, GLsizei count, const GLchar* const* strings, const GLint* lengths);
                                                                                                                                 ^
In file included from src/gl-fun.h:29:0,
                 from src/debuglogger.cpp:27:
/usr/include/SDL2/SDL_opengl.h:5685:25: note: previous declaration as ‘typedef void (* PFNGLSHADERSOURCEPROC)(GLuint, GLsizei, const GLchar**, const GLint*)’
 typedef void (APIENTRYP PFNGLSHADERSOURCEPROC) (GLuint shader, GLsizei count, const GLchar* *string, const GLint *length);
                         ^
make[1]: *** [src/mkxp-debuglogger.o] Error 1
make[1]: *** Waiting for unfinished jobs....
In file included from src/gl-util.h:25:0,
                 from src/bitmap.cpp:32:
src/gl-fun.h:72:129: error: conflicting declaration ‘typedef void (* PFNGLSHADERSOURCEPROC)(GLuint, GLsizei, const GLchar* const*, const GLint*)’
 typedef void (APIENTRYP PFNGLSHADERSOURCEPROC) (GLuint shader, GLsizei count, const GLchar* const* strings, const GLint* lengths);
                                                                                                                                 ^
In file included from src/gl-fun.h:29:0,
                 from src/gl-util.h:25,
                 from src/bitmap.cpp:32:
/usr/include/SDL2/SDL_opengl.h:5685:25: note: previous declaration as ‘typedef void (* PFNGLSHADERSOURCEPROC)(GLuint, GLsizei, const GLchar**, const GLint*)’
 typedef void (APIENTRYP PFNGLSHADERSOURCEPROC) (GLuint shader, GLsizei count, const GLchar* *string, const GLint *length);
                         ^
In file included from src/gl-fun.cpp:22:0:
src/gl-fun.h:72:129: error: conflicting declaration ‘typedef void (* PFNGLSHADERSOURCEPROC)(GLuint, GLsizei, const GLchar* const*, const GLint*)’
 typedef void (APIENTRYP PFNGLSHADERSOURCEPROC) (GLuint shader, GLsizei count, const GLchar* const* strings, const GLint* lengths);
                                                                                                                                 ^
In file included from src/gl-fun.h:29:0,
                 from src/gl-fun.cpp:22:
/usr/include/SDL2/SDL_opengl.h:5685:25: note: previous declaration as ‘typedef void (* PFNGLSHADERSOURCEPROC)(GLuint, GLsizei, const GLchar**, const GLint*)’
 typedef void (APIENTRYP PFNGLSHADERSOURCEPROC) (GLuint shader, GLsizei count, const GLchar* *string, const GLint *length);
                         ^
make[1]: *** [src/mkxp-bitmap.o] Error 1
make[1]: *** [src/mkxp-gl-fun.o] Error 1
make: *** [all] Error 2
hanetzer commented 9 years ago
diff --git a/src/gl-fun.h b/src/gl-fun.h
index 42cd4d7..947a8e4 100644
--- a/src/gl-fun.h
+++ b/src/gl-fun.h
@@ -69,7 +69,7 @@ typedef void (APIENTRYP PFNGLBUFFERSUBDATAPROC) (GLenum target, GLintptr offset,
 /* Shader */
 typedef GLuint (APIENTRYP PFNGLCREATESHADERPROC) (GLenum type);
 typedef void (APIENTRYP PFNGLDELETESHADERPROC) (GLuint shader);
-typedef void (APIENTRYP PFNGLSHADERSOURCEPROC) (GLuint shader, GLsizei count, const GLchar* const* strings, const GLint* lengths);
+typedef void (APIENTRYP PFNGLSHADERSOURCEPROC) (GLuint shader, GLsizei count, const GLchar* *strings, const GLint* length);
 typedef void (APIENTRYP PFNGLCOMPILESHADERPROC) (GLuint shader);
 typedef void (APIENTRYP PFNGLATTACHSHADERPROC) (GLuint program, GLuint shader);
 typedef void (APIENTRYP PFNGLGETSHADERIVPROC) (GLuint shader, GLenum pname, GLint* param);

removing a bit 'fixed' the issue, not sure if others would arise from this.

Ancurio commented 9 years ago

Fixed: 276160f0d5048c372efbba919cf355dcab992167