if funcs or enums:
if funcs:
for f in funcs:
- out.write("typedef %s (*%s)(%s);\n"%(f.return_type, f.typedef, ", ".join(f.params)))
+ out.write("typedef %s (APIENTRY *%s)(%s);\n"%(f.return_type, f.typedef, ", ".join(f.params)))
out.write("\n")
if enums:
if funcs:
out.write("""
#ifdef __APPLE__
-#define GET_PROC_ADDRESS(x) ::x
+#define GET_PROC_ADDRESS(x) &::x
#else
#define GET_PROC_ADDRESS(x) get_proc_address(#x)
#endif
+
+#ifdef WIN32
+#define GET_PROC_ADDRESS_1_1(x) &::x
+#else
+#define GET_PROC_ADDRESS_1_1(x) GET_PROC_ADDRESS(x)
+#endif
""")
out.write("""
namespace Msp {
out.write(")\n\t{\n")
for f in funcs:
if target_api in f.supported_apis:
- out.write("\t\t%s = reinterpret_cast<%s>(GET_PROC_ADDRESS(%s));\n"%(f.name, f.typedef, f.name))
+ gpa_suffix = ""
+ if f.version<=[1, 1]:
+ gpa_suffix = "_1_1"
+ 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")
if source_ext and source_ext!=backport_ext: