Skip to content

Commit

Permalink
Fix: PFN_vkDebugReportCallbackEXT now correctly uses const(char)* ins…
Browse files Browse the repository at this point in the history
…tead of const char* parameter types where applicable
  • Loading branch information
ParticlePeter committed Aug 27, 2016
1 parent e8b7602 commit fc6a628
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
17 changes: 15 additions & 2 deletions erupt.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ def endFeature(self):
# write contents of type section
contents = self.sections[section]
if contents:
# check if opaque structs were registered and write tem into types file
# check if opaque structs were registered and write them into types file
if section == 'struct':
if self.opaqueStruct:
for opaque in self.opaqueStruct:
Expand Down Expand Up @@ -440,8 +440,21 @@ def genType(self, typeinfo, name):
returnType = re.match(re_funcptr, typeinfo.elem.text).group(1)
params = "".join(islice(typeinfo.elem.itertext(), 2, None))[2:]
if params == "void);" : params = ");"
else: params = ' '.join(' '.join(line.strip() for line in params.splitlines()).split())
#else: params = ' '.join(' '.join(line.strip() for line in params.splitlines()).split())
else:
concatParams = ""
for line in params.splitlines():
lineSplit = line.split()
if len(lineSplit) > 2:
concatParams += ' ' + convertTypeConst(lineSplit[0] + ' ' + lineSplit[1]) + ' ' + lineSplit[2]
else:
concatParams += ' ' + ' '.join( param for param in lineSplit )

params = concatParams[2:]

self.appendSection("funcpointer", "alias {0} = {1} function({2}".format(name, returnType, params))
#write( params, file=self.testsFile )


elif category == "struct" or category == "union":
self.genStruct(typeinfo, name)
Expand Down
2 changes: 1 addition & 1 deletion source/erupted/types.d
Original file line number Diff line number Diff line change
Expand Up @@ -3577,7 +3577,7 @@ enum VK_DEBUG_REPORT_DEBUG_BIT_EXT = VkDebugReportFlagBitsEXT.VK_DEBUG_REPORT_DE
enum VK_DEBUG_REPORT_FLAG_BITS_MAX_ENUM_EXT = VkDebugReportFlagBitsEXT.VK_DEBUG_REPORT_FLAG_BITS_MAX_ENUM_EXT;
alias VkDebugReportFlagsEXT = VkFlags;

alias PFN_vkDebugReportCallbackEXT = VkBool32 function(VkDebugReportFlagsEXT flags, VkDebugReportObjectTypeEXT objectType, uint64_t object, size_t location, int32_t messageCode, const char* pLayerPrefix, const char* pMessage, void* pUserData);
alias PFN_vkDebugReportCallbackEXT = VkBool32 function(VkDebugReportFlagsEXT flags, VkDebugReportObjectTypeEXT objectType, uint64_t object, size_t location, int32_t messageCode, const(char)* pLayerPrefix, const(char)* pMessage, void* pUserData);

struct VkDebugReportCallbackCreateInfoEXT {
VkStructureType sType = VkStructureType.VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT;
Expand Down

0 comments on commit fc6a628

Please sign in to comment.