From 726e4dac25deeb9e4584226bdbafa1fd93ba3162 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Fri, 6 Jan 2017 13:48:17 +0200 Subject: [PATCH] Guard against missing extensions on OS X Symbols are linked directly so the definitions must be present in the system OpenGL library at compile time. --- scripts/extgen.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/extgen.py b/scripts/extgen.py index 8d7bfcb1..b3319e59 100755 --- a/scripts/extgen.py +++ b/scripts/extgen.py @@ -518,6 +518,7 @@ for f in funcs: out.write("\nExtension::SupportLevel init_%s()\n{\n"%target_ext.name.lower()) if core_version: out.write("\tif(is_disabled(\"GL_%s\"))\n\t\treturn Extension::UNSUPPORTED;\n"%target_ext.name) + out.write("#if !defined(__APPLE__) || defined(GL_VERSION_%d_%d)\n"%tuple(core_version)) out.write("\tif(") if backport_ext: out.write("is_supported(\"GL_%s\") || "%backport_ext.name) @@ -533,7 +534,9 @@ if core_version: out.write("\t\t%s = reinterpret_cast<%s>(GET_PROC_ADDRESS%s(%s));\n"%(f.name, f.typedef, gpa_suffix, f.name)) out.write("\t\treturn Extension::CORE;\n") out.write("\t}\n") + out.write("#endif\n") if source_ext and source_ext!=backport_ext: + out.write("#if !defined(__APPLE__) || defined(GL_%s)\n"%target_ext.name) out.write("\tif(is_supported(\"GL_%s\"))\n\t{\n"%(source_ext.name)) for f in funcs: if f.sources: @@ -553,6 +556,7 @@ if source_ext and source_ext!=backport_ext: out.write("\t\t%s = reinterpret_cast<%s>(GET_PROC_ADDRESS(%s));\n"%(f.name, f.typedef, src.name)) out.write("\t\treturn Extension::EXTENSION;\n") out.write("\t}\n") + out.write("#endif\n") out.write("\treturn Extension::UNSUPPORTED;\n") out.write("}\n") -- 2.43.0