Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 80361 - nvidia-glx/gtkglext glext.h incompatibility
Summary: nvidia-glx/gtkglext glext.h incompatibility
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All All
: High major (vote)
Assignee: Jeremy Huddleston (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-02-01 10:22 UTC by Ed Catmur
Modified: 2005-05-03 12:51 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
NVIDIA_glx-1.0.6629-defines2.patch (NVIDIA_glx-1.0.6629-defines2.patch,2.01 KB, patch)
2005-02-01 10:25 UTC, Ed Catmur
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ed Catmur 2005-02-01 10:22:52 UTC
From http://bugs.gentoo.org/show_bug.cgi?id=79693#c5 there is an incompatibility between the glext.h in nvidia-glx and the glext.h in gtkglext.

Because the glext.h in gtkglext is derived from the SGI OpenGL 1.2.1 sample implementation it is more apt to be correct; also examination of the #ifdefs suggest that gtkglext has got it right.

This means that any program using gdkglglext.h will fail:

$ echo '#include <gdk/gdkglglext.h>' >foo.c; gcc $(pkg-config --cflags gtkglext-1.0) foo.c
In file included from /usr/include/gtkglext-1.0/gdk/gdkglglext.h:53,
                 from foo.c:1:
/usr/include/gtkglext-1.0/gdk/glext/glext.h:1540:1: warning: "GL_RESTART_SUN" redefined
In file included from /usr/X11R6/include/GL/gl.h:71,
                 from /usr/include/gtkglext-1.0/gdk/gdkglglext.h:33,
                 from foo.c:1:
/usr/X11R6/include/GL/glext.h:2215:1: warning: this is the location of the previous definition
In file included from /usr/include/gtkglext-1.0/gdk/gdkglglext.h:53,
                 from foo.c:1:
/usr/include/gtkglext-1.0/gdk/glext/glext.h:1541:1: warning: "GL_REPLACE_MIDDLE_SUN" redefined
In file included from /usr/X11R6/include/GL/gl.h:71,
                 from /usr/include/gtkglext-1.0/gdk/gdkglglext.h:33,
                 from foo.c:1:
/usr/X11R6/include/GL/glext.h:2216:1: warning: this is the location of the previous definition
In file included from /usr/include/gtkglext-1.0/gdk/gdkglglext.h:53,
                 from foo.c:1:
/usr/include/gtkglext-1.0/gdk/glext/glext.h:1542:1: warning: "GL_REPLACE_OLDEST_SUN" redefined
In file included from /usr/X11R6/include/GL/gl.h:71,
                 from /usr/include/gtkglext-1.0/gdk/gdkglglext.h:33,
                 from foo.c:1:
/usr/X11R6/include/GL/glext.h:2217:1: warning: this is the location of the previous definition
In file included from /usr/include/gtkglext-1.0/gdk/gdkglglext.h:53,
                 from foo.c:1:
/usr/include/gtkglext-1.0/gdk/glext/glext.h:3810: error: redefinition of typedef 'PFNGLCOLORSUBTABLEEXTPROC'
/usr/X11R6/include/GL/glext.h:3223: error: previous declaration of 'PFNGLCOLORSUBTABLEEXTPROC' was here

The nvidia glext.h has:

#ifndef GL_EXT_paletted_texture
#define GL_EXT_paletted_texture 1
#ifdef GL_GLEXT_PROTOTYPES
extern void APIENTRY glColorTableEXT (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *);
extern void APIENTRY glColorSubTableEXT (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data);
extern void APIENTRY glGetColorTableEXT (GLenum, GLenum, GLenum, GLvoid *);
extern void APIENTRY glGetColorTableParameterivEXT (GLenum, GLenum, GLint *);
extern void APIENTRY glGetColorTableParameterfvEXT (GLenum, GLenum, GLfloat *);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRY * PFNGLCOLORTABLEEXTPROC) (GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const GLvoid *table);
typedef void (APIENTRY * PFNGLCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data);
typedef void (APIENTRY * PFNGLGETCOLORTABLEEXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *data);
typedef void (APIENTRY * PFNGLGETCOLORTABLEPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
typedef void (APIENTRY * PFNGLGETCOLORTABLEPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params);
#endif

By comparison with the gtkglext glext.h it is clear that the defines and typedefs regarding subtables should go in an #ifndef GL_EXT_color_subtable section.

The patch I will attach will accomplish this, causing the nvidia and gtkglext glext.h to become compatible.
Comment 1 Ed Catmur 2005-02-01 10:25:03 UTC
Created attachment 50149 [details, diff]
NVIDIA_glx-1.0.6629-defines2.patch

This is the same patch as attached to bug 79693. It is quite short and can
probably be merged into the existing NVIDIA_glx-1.0.6629-defines.patch in the
nvidia-glx ebuild.

To reiterate: it is the nvidia-glx glext.h that is broken and needs patching to
prevent it breaking programs that use gdkglglext.h from gtkglext.
Comment 2 Jeremy Huddleston (RETIRED) gentoo-dev 2005-02-10 01:57:31 UTC
Does it compile fine if you use the glext.h from opengl-update-2.1.1 (you will need to manually set the symlink in /usr/include/GL)?
Comment 3 Ed Catmur 2005-02-10 02:31:24 UTC
Sorry, hit bug 81385.

Yes, it works with /usr/lib/opengl/global/include/glext.h.
Comment 4 Jeremy Huddleston (RETIRED) gentoo-dev 2005-02-10 02:50:21 UTC
actually, I'm sorry you hit bug 81385... but I digress... I think this patch can go into nvidia-glx, but in the future maybe opengl-update should use the global files rather than the ones provided by the package unless '--override-headers' is used or something similar...  I'll get to this soon.  Thanks.
Comment 5 Jeremy Huddleston (RETIRED) gentoo-dev 2005-05-03 12:51:49 UTC
opengl-update now uses the global headers instead.