enums.sort(key=(lambda e: e.value))
# Some final preparations for creating the files
+core_version_candidates = {}
backport_ext_candidates = []
for t in itertools.chain(funcs, enums):
if target_api in t.supported_apis and t.supported_apis[target_api]!="ext":
t.version = t.supported_apis[target_api]
- if not core_version:
- core_version = t.version
+ if t.version:
+ ver_tuple = tuple(t.version)
+ core_version_candidates[ver_tuple] = core_version_candidates.get(ver_tuple, 0)+1
# Things in backport extensions don't acquire an extension suffix
if t.extension and not t.name.endswith(ext_type) and target_api in t.supported_apis:
if t.extension not in backport_ext_candidates:
backport_ext_candidates.append(t.extension)
+if not core_version and core_version_candidates:
+ core_version_candidates = list((v, k) for k, v in core_version_candidates.items())
+ if len(core_version_candidates)>1:
+ core_version_candidates.sort(reverse=True)
+ if core_version_candidates[1][0]+1>=core_version_candidates[0][0]:
+ ver0 = core_version_candidates[0][1]
+ ver1 = core_version_candidates[1][1]
+ print "Warning: multiple likely core version candidates: %d.%d %d.%d"%(ver0[0], ver0[1], ver1[0], ver1[1])
+ core_version = core_version_candidates[0][1]
+
if backport_ext:
if backport_ext=="none":
backport_ext = None