]> git.cworth.org Git - apitrace/blobdiff - glproc.py
Cleanup the ApiTraceFrame a bit.
[apitrace] / glproc.py
index 2fde623cb8f7cb10fe1cf89880b409137a1ce5a7..29031b7002798c70da499d5b51ff2e0bbeb2b482 100644 (file)
--- a/glproc.py
+++ b/glproc.py
@@ -410,20 +410,20 @@ 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 '     static void *libgl_handle = RTLD_NEXT;'
-        print '#    define __getPublicProcAddress(name) dlsym(libgl_handle, name)'
+        print '#    define __getPublicProcAddress(name) __dlsym(name)'
         print '#    define __getPrivateProcAddress(name) __glXGetProcAddressARB((const GLubyte *)(name))'
+        print '     static void * __dlsym(const char *symbol);'
         print '     static inline __GLXextFuncPtr __glXGetProcAddressARB(const GLubyte * procName);'
         print '#  endif'
         print '#  define __abort() Trace::Abort()'
@@ -445,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