diff options
author | Ian Romanick <idr@us.ibm.com> | 2005-01-28 19:00:54 +0000 |
---|---|---|
committer | Ian Romanick <idr@us.ibm.com> | 2005-01-28 19:00:54 +0000 |
commit | 16c3c7401846bbc7c300e6a9b433584ec5b68699 (patch) | |
tree | b34e784e5b84cf802a50fae6d1544aae4bd28b14 /src/mesa/glapi/glX_proto_size.py | |
parent | 8d27148bbd13fbc8192f9c5aeeb9b39b92f1045d (diff) | |
download | external_mesa3d-16c3c7401846bbc7c300e6a9b433584ec5b68699.zip external_mesa3d-16c3c7401846bbc7c300e6a9b433584ec5b68699.tar.gz external_mesa3d-16c3c7401846bbc7c300e6a9b433584ec5b68699.tar.bz2 |
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/glX_proto_size.py')
-rw-r--r-- | src/mesa/glapi/glX_proto_size.py | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/mesa/glapi/glX_proto_size.py b/src/mesa/glapi/glX_proto_size.py index ecab65d..cf0885a 100644 --- a/src/mesa/glapi/glX_proto_size.py +++ b/src/mesa/glapi/glX_proto_size.py @@ -166,18 +166,13 @@ class PrintGlxSizeStubs_c(PrintGlxSizeStubs_common): class PrintGlxSizeStubs_h(PrintGlxSizeStubs_common): def printRealHeader(self): - print """ -/** + print """/** * \\file * Prototypes for functions used to determine the number of data elements in * various GLX protocol messages. * * \\author Ian Romanick <idr@us.ibm.com> */ - -#if !defined( _GLXSIZE_H_ ) -# define _GLXSIZE_H_ - """ glX_XML.printPure(); print '' @@ -191,7 +186,6 @@ class PrintGlxSizeStubs_h(PrintGlxSizeStubs_common): print "# undef INTERNAL" print "# undef PURE" print "# undef FASTCALL" - print "#endif /* !defined( _GLXSIZE_H_ ) */" def printFunction(self, f): @@ -215,11 +209,12 @@ if __name__ == '__main__': file_name = "gl_API.xml" try: - (args, trail) = getopt.getopt(sys.argv[1:], "f:m:", ["only-get", "only-set", "get-alias-set"]) + (args, trail) = getopt.getopt(sys.argv[1:], "f:m:h:", ["only-get", "only-set", "get-alias-set", "header-tag"]) except Exception,e: show_usage() mode = None + header_tag = None which_functions = PrintGlxSizeStubs_common.do_get | PrintGlxSizeStubs_common.do_set for (arg,val) in args: @@ -233,11 +228,15 @@ if __name__ == '__main__': which_functions = PrintGlxSizeStubs_common.do_set elif arg == "--get-alias-set": which_functions |= PrintGlxSizeStubs_common.do_get_alias_set + elif (arg == '-h') or (arg == "--header-tag"): + header_tag = val if mode == "size_c": dh = PrintGlxSizeStubs_c( which_functions ) elif mode == "size_h": dh = PrintGlxSizeStubs_h( which_functions ) + if header_tag: + dh.header_tag = header_tag else: show_usage() |