glapi: Prevent accidental use of lies w/shared-glapi
authorIan Romanick <ian.d.romanick@intel.com>
Wed, 1 Aug 2012 00:23:35 +0000 (17:23 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Wed, 8 Aug 2012 17:06:26 +0000 (10:06 -0700)
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
src/mapi/glapi/gen/gl_table.py

index 7f3b91513fe7fed7f953e330c0387ea72837999d..a0ae4c39af468bfb27f20d7aee9c1f0e94c59d01 100644 (file)
@@ -39,14 +39,20 @@ class PrintGlTable(gl_XML.gl_print_base):
                self.license = license.bsd_license_template % ( \
 """Copyright (C) 1999-2003  Brian Paul   All Rights Reserved.
 (C) Copyright IBM Corporation 2004""", "BRIAN PAUL, IBM")
+               self.ifdef_emitted = False;
                return
 
 
        def printBody(self, api):
                for f in api.functionIterateByOffset():
+                       if not f.is_abi() and not self.ifdef_emitted:
+                               print '#if !defined HAVE_SHARED_GLAPI'
+                               self.ifdef_emitted = True
                        arg_string = f.get_parameter_string()
                        print '   %s (GLAPIENTRYP %s)(%s); /* %d */' % (f.return_type, f.name, arg_string, f.offset)
 
+               print '#endif /* !defined HAVE_SHARED_GLAPI */'
+
 
        def printRealHeader(self):
                print '#ifndef GLAPIENTRYP'