From: Braden M. <br...@en...> - 2006-12-09 08:02:07
|
I've managed to locate a PPC Mac where I can test this a bit. For those of you playing along with the home game, try this... Go to line 290 of /System/Library/Frameworks/OpenGL.framework/Headers/glu.h. You should find the declaration of gluTessCallback there; note that it's inside an extern "C" block. Copy the declaration of gluTessCallback. Now go to src/libopenvrml-gl/openvrml/gl/viewer.cpp. Create an extern "C" block after <OpenGL/glu.h> is included and paste the definition of gluTessCallback there. You should wind up with something that looks like this: # if HAVE_APPLE_OPENGL_FRAMEWORK # include <OpenGL/gl.h> # include <OpenGL/glu.h> # else # include <GL/gl.h> # include <GL/glu.h> # endif extern "C" { extern void gluTessCallback (GLUtesselator* tess, GLenum which, GLvoid (*CallBackFunc)()); } Now compile. Here's what you get: ../../../src/libopenvrml-gl/openvrml/gl/viewer.cpp:42: error: declaration of C function 'void gluTessCallback(GLUtesselator*, GLenum, GLvoid (*)())' conflicts with /System/Library/Frameworks/OpenGL.framework/Headers/glu.h:290: error: previous declaration 'void gluTessCallback(GLUtesselator*, GLenum, GLvoid (*)(...))' here WTF??? That is some first class brain damage there. I know nothing about how frameworks work on Mac OS X; but I can only guess from this behavior that the compiler is checking something *other* than the source code (i.e., glu.h) for the type associated with the external symbol--presumably some sort of manifest associated with the framework. Clues welcome. In the absence of further input with a better suggestion, I'm going to make the declaration of TessCB dependent on HAVE_APPLE_OPENGL_FRAMEWORK: # if HAVE_APPLE_OPENGL_FRAMEWORK typedef GLvoid (*OPENVRML_GL_CALLBACK_ TessCB)(...); # else typedef GLvoid (*OPENVRML_GL_CALLBACK_ TessCB)(GLvoid); # endif -- Braden McDaniel e-mail: <br...@en...> <http://endoframe.com> Jabber: <br...@ja...> |