Ticket #311 (closed crash: fixed)
conflicting declarations in GL headers
| Reported by: | niederstrasser@… | Owned by: | jeremyhu@… |
|---|---|---|---|
| Priority: | Nice to Have | Milestone: | 2.5.0 |
| Component: | GLX | Version: | 2.4.0 (xserver-1.5.3-apple14) |
| Keywords: | Cc: |
Description (last modified by jeremyhu@…) (diff)
Building mozilla-central from the tip, I'm getting the following error with the GL headers inside /usr/X11R6
/usr/bin/g++-4.2 -o WebGLContext.o -c -fvisibility=hidden -DUSE_GLX -DMOZILLA_INTERNAL_API -D_IMPL_NS_COM -DEXPORT_XPT_API -DEXPORT_XPTC_API -D_IMPL_NS_GFX -D_IMPL_NS_WIDGET -DIMPL_XREAPI -DIMPL_NS_NET -DIMPL_THEBES -DZLIB_INTERNAL -DOSTYPE=\"Darwin\" -DOSARCH=Darwin -D_IMPL_NS_LAYOUT -I/src/mozilla-central/content/canvas/src -I. -I../../../dist/include -I../../../dist/include/nsprpub -I/src/mozilla-central/obj-i386-apple-darwin9.8.0-browser/dist/include/nspr -I/src/mozilla-central/obj-i386-apple-darwin9.8.0-browser/dist/include/nss -I/sw/include -I/src/mozilla-central/content/canvas/src/../../../layout/xul/base/src -I/src/mozilla-central/content/canvas/src/../../../layout/style -I/src/mozilla-central/content/canvas/src/../../../layout/generic -I/src/mozilla-central/content/canvas/src/../../base/src -I/src/mozilla-central/content/canvas/src/../../html/content/src -fPIC -fno-rtti -fno-exceptions -Wall -Wpointer-arith -Woverloaded-virtual -Wsynth -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor -Wcast-align -Wno-invalid-offsetof -Wno-long-long -fno-strict-aliasing -fpascal-strings -fno-common -fshort-wchar -pthread -DNDEBUG -DTRIMMED -O3 -I/src/mozilla-central/obj-i386-apple-darwin9.8.0-browser/dist/include/cairo -I/sw/include/gtk-2.0 -I/sw/lib/gtk-2.0/include -I/sw/include/atk-1.0 -I/sw/include/cairo -I/sw/include/pango-1.0 -I/sw/include/glib-2.0 -I/sw/lib/glib-2.0/include -I/sw/include/pixman-1 -I/sw/include/freetype2 -I/sw/include -I/sw/include/libpng12 -I/sw/include/gtk-unix-print-2.0 -I/usr/X11R6/include -I/usr/X11/include -DMOZILLA_CLIENT -include ../../../mozilla-config.h -Wp,-MD,.deps/WebGLContext.pp /src/mozilla-central/content/canvas/src/WebGLContext.cpp
In file included from /usr/X11R6/include/GL/gl.h:1987,
from /usr/X11R6/include/GL/glx.h:45,
from /src/mozilla-central/content/canvas/src/nsGLPbuffer.h:62,
from /src/mozilla-central/content/canvas/src/WebGLContext.h:59,
from /src/mozilla-central/content/canvas/src/WebGLContext.cpp:2:
/usr/X11R6/include/GL/glext.h:4020: error: conflicting declaration ‘typedef void (* PFNGLTEXIMAGE3DPROC)(unsigned int, int, int, int, int, int, int, unsigned int, unsigned int, const GLvoid*)’
/usr/X11R6/include/GL/gl.h:1740: error: ‘PFNGLTEXIMAGE3DPROC’ has a previous declaration as ‘typedef void (* PFNGLTEXIMAGE3DPROC)(unsigned int, int, unsigned int, int, int, int, int, unsigned int, unsigned int, const GLvoid*)’
/usr/X11R6/include/GL/glext.h:4178: error: conflicting declaration ‘typedef void (* PFNGLMULTIDRAWARRAYSPROC)(unsigned int, int*, int*, int)’
/usr/X11R6/include/GL/gl.h:1850: error: ‘PFNGLMULTIDRAWARRAYSPROC’ has a previous declaration as ‘typedef void (* PFNGLMULTIDRAWARRAYSPROC)(unsigned int, const int*, const int*, int)’
make[1]: *** [WebGLContext.o] Error 1
I'm on OS X 10.5.8 with the xquartz-2.4.0 (and various 2.3.x versions before that) update installed.
Change History
comment:2 Changed 4 years ago by jeremyhu@…
- Status changed from new to assigned
The gl.h prototypes are from OpenGL.framework, the glext.h prototypes are from OpenGL.org
OpenGL.framework has:
typedef void (* glTexImage3DProcPtr) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); typedef void (* glMultiDrawArraysProcPtr) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount);
Man page:
void glTexImage3D( GLenum target,
GLint level,
GLenum internalformat,
GLsizei width,
GLsizei height,
GLsizei depth,
GLint border,
GLenum format,
GLenum type,
const GLvoid *pixels )
void glMultiDrawArrays( GLenum mode,
GLint * first,
GLsizei * count,
GLsizei primcount);
comment:3 Changed 4 years ago by jeremyhu@…
- Milestone set to OpenGL.framework DRI
hmm... OpenGL.org shows:
void glTexImage3D( GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid * data);
comment:4 Changed 4 years ago by jeremyhu@…
X11 is doing this "right" ... OpenGL.framwork is buggy. Feel free to open a bug at http://bugreport.apple.com
Reference:
<rdar://problem/6953344> gl.h contains incorrect prototypes for glTexImage[123]D <rdar://problem/7238648> gl.h incorrectly prototypes glMultiDrawArrays
comment:5 Changed 4 years ago by niederstrasser@…
I'm not sure I follow. Is this saying that /usr/X11/include/GL/gl.h is from Apple's OpenGL.framework and glext.h is from the OpenGL.org sources? But if I have xquartz, which includes both gl.h and glext.h, shouldn't they come from the same source? If this is an Apple bug, I would love to file a new radar entry, but I don't really know what I would have to say in it.
comment:6 Changed 4 years ago by jeremyhu@…
/usr/X11/include/GL/gl.h is generated from OpenGL.framework's gl.h
OpenGL.org doesn't have "sources" they release the spec and provide headers consistent with the spec.
There is a conflict between OpenGL.framework's gl.h and the OpenGL.org spec.
You can say, "The glTexImage3DProcPtr and glMultiDrawArraysProcPtr declarations in OpenGL.framework's gl.h do not match the OpenGL specification. OpenGL.framework includes the following:
typedef void (* glTexImage3DProcPtr) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); typedef void (* glMultiDrawArraysProcPtr) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount);
but the spec shows these should be:
typedef void (* glTexImage3DProcPtr) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); typedef void (* glMultiDrawArraysProcPtr) (GLenum mode, GLint *first, GLsizei *count, GLsizei primcount);
