Source

glLoadGen / modules / CommonStyle.lua

Diff from to

modules/CommonStyle.lua

 	hFile:write "\n"
 	
 	--Write the mapping table itself.
-	hFile:fmt("static %s %s[] = {\n",
+	local arrayLength = #options.extensions
+	if(arrayLength == 0) then arrayLength = 1 end
+	hFile:fmt("static %s %s[%i] = {\n",
 		structName,
-		varName)
+		varName,
+		arrayLength)
 	hFile:inc()
 	for _, extName in ipairs(options.extensions) do
 		if(#specData.extdefs[extName].funcs > 0) then
 				GetExtVariableName(extName, spec, options))
 		end
 	end
+	--Because C is stupid, write bogus entry.
+	if(#options.extensions == 0) then
+		hFile:fmt('{"", NULL, NULL},\n')
+	end
 	hFile:dec()
 	hFile:write("};\n")