]> git.cworth.org Git - apitrace/blobdiff - glproc.py
Add an action to show and hide the errors dock.
[apitrace] / glproc.py
index fa1db1ec423f61f1908161f61097b96e1aab941d..e1e7d16f3ed164ec3369859f413f16f2c40e8feb 100644 (file)
--- a/glproc.py
+++ b/glproc.py
@@ -410,18 +410,19 @@ class GlDispatcher(Dispatcher):
 
     def header(self):
         print '#ifdef RETRACE'
-        print '#  ifdef WIN32'
+        print '#  ifdef _WIN32'
         print '#    define __getPrivateProcAddress(name) wglGetProcAddress(name)'
         print '#  else'
         print '#    define __getPrivateProcAddress(name) glXGetProcAddressARB((const GLubyte *)(name))'
         print '#  endif'
         print '#  define __abort() OS::Abort()'
         print '#else /* !RETRACE */'
-        print '#  ifdef WIN32'
+        print '#  ifdef _WIN32'
         print '#    define __getPrivateProcAddress(name) __wglGetProcAddress(name)'
         print '     static inline PROC __stdcall __wglGetProcAddress(const char * lpszProc);'
         print '#  else'
-        print '#    define __getPublicProcAddress(name) dlsym(RTLD_NEXT, name)'
+        print '     static void *libgl_handle = RTLD_NEXT;'
+        print '#    define __getPublicProcAddress(name) dlsym(libgl_handle, name)'
         print '#    define __getPrivateProcAddress(name) __glXGetProcAddressARB((const GLubyte *)(name))'
         print '     static inline __GLXextFuncPtr __glXGetProcAddressARB(const GLubyte * procName);'
         print '#  endif'
@@ -444,13 +445,13 @@ if __name__ == '__main__':
     print
     dispatcher = GlDispatcher()
     dispatcher.header()
-    print '#ifdef WIN32'
+    print '#ifdef _WIN32'
     print
     dispatcher.dispatch_api(wglapi)
-    print '#else /* !WIN32 */'
+    print '#else /* !_WIN32 */'
     print
     dispatcher.dispatch_api(glxapi)
-    print '#endif /* !WIN32 */'
+    print '#endif /* !_WIN32 */'
     print
     dispatcher.dispatch_api(glapi)
     print