From f159ebc4120fb057c9d59efb0e5c7c36bff6f40a Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Mon, 16 Jun 2014 23:06:01 +0300 Subject: [PATCH] Use GL_VERSION_x_y to guard the enums for promoted extensions 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 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/extgen.py b/scripts/extgen.py index 7ab8abc3..7a1b1862 100755 --- a/scripts/extgen.py +++ b/scripts/extgen.py @@ -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") -- 2.43.0