summaryrefslogtreecommitdiff
path: root/src/mesa/glapi/gl_XML.py
diff options
context:
space:
mode:
authorIan Romanick <idr@us.ibm.com>2005-01-28 19:00:54 +0000
committerIan Romanick <idr@us.ibm.com>2005-01-28 19:00:54 +0000
commit16c3c7401846bbc7c300e6a9b433584ec5b68699 (patch)
treeb34e784e5b84cf802a50fae6d1544aae4bd28b14 /src/mesa/glapi/gl_XML.py
parent8d27148bbd13fbc8192f9c5aeeb9b39b92f1045d (diff)
Refactor the code to emit multiple-inclusion protection to
FilterGLAPISpecBase. Since the size_h mode of glX_proto_size.py will be used to generate multiple header files, add an option to specify the define that is used for multiple-inclusion protection. The changes to the header files in this commit are just a side-effect of the changes to the Python scripts.
Diffstat (limited to 'src/mesa/glapi/gl_XML.py')
-rw-r--r--src/mesa/glapi/gl_XML.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/mesa/glapi/gl_XML.py b/src/mesa/glapi/gl_XML.py
index 16499df094..21f6dc0e62 100644
--- a/src/mesa/glapi/gl_XML.py
+++ b/src/mesa/glapi/gl_XML.py
@@ -494,6 +494,7 @@ class FilterGLAPISpecBase(saxutils.XMLFilterBase):
self.types = {}
self.xref = {}
self.factory = glItemFactory()
+ self.header_tag = None
def find_type(self,type_name):
@@ -529,6 +530,10 @@ class FilterGLAPISpecBase(saxutils.XMLFilterBase):
print ' * ' + self.license.replace('\n', '\n * ')
print ' */'
print ''
+ if self.header_tag:
+ print '#if !defined( %s )' % (self.header_tag)
+ print '# define %s' % (self.header_tag)
+ print ''
self.printRealHeader();
return
@@ -538,6 +543,9 @@ class FilterGLAPISpecBase(saxutils.XMLFilterBase):
self.printFunctions()
self.printRealFooter()
+ if self.header_tag:
+ print ''
+ print '#endif /* !defined( %s ) */' % (self.header_tag)
def get_category_define(self):