]> git.tdb.fi Git - libs/gl.git/commitdiff
Use GL_VERSION_x_y to guard the enums for promoted extensions
authorMikko Rasa <tdb@tdb.fi>
Mon, 16 Jun 2014 20:06:01 +0000 (23:06 +0300)
committerMikko Rasa <tdb@tdb.fi>
Mon, 16 Jun 2014 20:06:01 +0000 (23:06 +0300)
The core names for enums are used in headers, and older systems might
have the extension present but too old core version.

scripts/extgen.py

index 7ab8abc3fc83ad8efebe031dc859866d98d6dda0..7a1b18629cafa4b2e5a116b316a2b9beb8e63346 100755 (executable)
@@ -263,7 +263,10 @@ if funcs or enums:
                out.write("#endif\n\n")
 
        if enums:
-               out.write("#ifndef GL_%s\n"%ext)
+               if ver:
+                       out.write("#ifndef GL_VERSION_%s\n"%"_".join(map(str, ver)))
+               else:
+                       out.write("#ifndef GL_%s\n"%ext)
                for e in enums:
                        out.write("#define %s 0x%04X\n"%(e.name, e.value))
                out.write("#endif\n\n")