Commits

Jason McKesson committed c8c68ce

glload: more error fixes.

Comments (0)

Files changed (3)

modules/StyleGLLoad.lua

 	local cppExtVarname = glload.GetExtVariableName(extName, spec, options)
 	local cExtVarname = glload_c.GetExtVariableName(extName, spec, options)
 	
-	hFile:fmt("exts::%s = glload::LoadTest((::%s == 0), ::%s - 1);\n",
+	hFile:fmt("exts::%s = glload::LoadTest((::%s != 0), ::%s - 1);\n",
 		cppExtVarname,
 		cExtVarname,
 		cExtVarname)

modules/StyleNoloadCpp.lua

 end
 
 function hdr.WriteExtVariable(hFile, extName, spec, options)
-	hFile:fmt("extern bool %s;\n", extName)
+	hFile:fmt("extern bool var_%s;\n", extName)
 end
 
 function hdr.WriteBlockBeginEnumerators(hFile, spec, options)
 end
 
 function src.WriteExtVariable(hFile, extName, spec, options)
-	hFile:fmt("bool %s = false;\n", extName)
+	hFile:fmt("bool var_%s = false;\n", extName)
 end
 
 function src.WriteSetupFunction(hFile, specData, spec, options)
 	hFile:inc()
 	
 	for _, extName in ipairs(options.extensions) do
-		hFile:fmt("exts::%s = false;\n", extName)
+		hFile:fmt("exts::var_%s = false;\n", extName)
 	end
 	
 	hFile:dec()
 	hFile:write "{\n"
 	hFile:inc()
 	for _, extName in ipairs(options.extensions) do
-		hFile:fmt('{"%s%s", &exts::%s},\n',
+		hFile:fmt('{"%s%s", &exts::var_%s},\n',
 			spec.ExtNamePrefix(),
 			extName,
 			extName)

modules/glload_util.lua

 	return spec.GetIncludeGuardString() .. "_GEN_LOAD_FUNCTIONS_HPP"
 end
 
+function data.cpp.GetExtVariableName(extName, spec, options)
+	return "var_" .. extName
+end
+
 function data.cpp.WriteNamespaceBegin(hFile, namespace)
 	hFile:fmt("namespace %s\n", namespace)
 	hFile:write("{\n")