]> git.cworth.org Git - apitrace/blobdiff - trace.py
Implement context sharing.
[apitrace] / trace.py
index 7d40cb7c5d9d8ad9cd3f78d34a23c39421bfc28f..7076c9ffa4a032f005ebd590b712fc7645a3dd94 100644 (file)
--- a/trace.py
+++ b/trace.py
@@ -90,7 +90,7 @@ class DumpDeclarator(stdapi.OnceVisitor):
         print '        Trace::LiteralSInt(value);'
         print '        return;'
         print '    }'
-        print '        Trace::LiteralEnum(sig);'
+        print '    Trace::LiteralEnum(sig);'
         print '}'
         print
 
@@ -313,8 +313,15 @@ class Tracer:
     def get_dispatch_function(self, function):
         return '__' + function.name
 
+    def is_public_function(self, function):
+        return True
+
     def trace_function_impl(self, function):
-        print 'extern "C" ' + function.prototype() + ' {'
+        if self.is_public_function(function):
+            print 'extern "C" PUBLIC'
+        else:
+            print 'extern "C" PRIVATE'
+        print function.prototype() + ' {'
         if function.type is not stdapi.Void:
             print '    %s __result;' % function.type
         self.trace_function_impl_body(function)
@@ -462,7 +469,8 @@ __getPublicProcAddress(LPCSTR lpProcName)
     return GetProcAddress(g_hDll, lpProcName);
 }
 
-    ''' % self.dllname
+#define __abort() OS::Abort()
+''' % self.dllname
 
         dispatcher = Dispatcher()
         dispatcher.dispatch_api(api)