Commits

Jason McKesson  committed c2900cb

Fix for issue #31.

  • Participants
  • Parent commits eb1d16c

Comments (0)

Files changed (3)

File modules/StyleNoloadCpp.lua

 	hFile:writeblock([[
 #include <algorithm>
 #include <string.h>
+#include <stddef.h>
 ]])
 
 	local base = util.ParsePath(hdr.GetFilename(basename, spec, options))

File modules/StylePointerC.lua

 	hFile:writeblock([[
 #include <stdlib.h>
 #include <string.h>
+#include <stddef.h>
 ]])
 	local base = util.ParsePath(my_style.header.GetFilename(basename, options))
 	hFile:fmt('#include "%s"\n', base)
 	return indexed
 end
 
-local function WriteInMainFuncLoader(hFile, func, spec, options)
-	hFile:fmt('%s = %s("%s%s");\n',
+local function WriteInMainFuncLoader(hFile, func, typemap, spec, options)
+	hFile:fmt('%s = (%s)%s("%s%s");\n',
 		GetFuncPtrName(func, spec, options),
+		GetFuncPtrType(hFile, func, typemap, spec, options),
 		common.GetProcAddressName(spec),
 		spec.FuncNamePrefix(), func.name)
 	hFile:fmt('if(!%s) return %s;\n',
 
 	--Load the extension, using runtime-facilities to tell what is available.
 	if(indexed) then
-		WriteInMainFuncLoader(hFile, indexed[1], spec, options)
-		WriteInMainFuncLoader(hFile, indexed[3], spec, options)
+		WriteInMainFuncLoader(hFile, indexed[1], specData.typemap, spec, options)
+		WriteInMainFuncLoader(hFile, indexed[3], specData.typemap, spec, options)
 		hFile:write("\n")
 		hFile:write("ProcExtsFromExtList();\n")
 	else
 				end
 			end
 			
-			WriteInMainFuncLoader(hFile, extListName, spec, options)
+			WriteInMainFuncLoader(hFile, extListName, specData.typemap, spec, options)
 			
 			extListName = GetFuncPtrName(extListName, spec, options);
 		end

File modules/StylePointerCPP.lua

 #include <algorithm>
 #include <vector>
 #include <string.h>
+#include <stddef.h>
 ]])
 
 	local base = util.ParsePath(my_style.header.GetFilename(basename, options))