- s = f.sources[0]
- if target_api in s.supported_apis:
- out.write("\t\t%s = reinterpret_cast<%s>(GET_PROC_ADDRESS(%s));\n"%(f.name, f.typedef, s.name))
+ src = None
+ for s in f.sources:
+ if s.name.endswith(source_ext.ext_type):
+ src = s
+ break
+ if not src:
+ src = f.sources[0]
+ else:
+ src = f
+
+ if target_api in src.supported_apis:
+ if not src.name.endswith(source_ext.ext_type):
+ print "Warning: %s does not match extension type %s"%(src.name, source_ext.ext_type)
+ out.write("\t\t%s = reinterpret_cast<%s>(GET_PROC_ADDRESS(%s));\n"%(f.name, f.typedef, src.name))