Fix stdcall parameter size computation

Signed-off-by: Duncan Ogilvie <mr.exodia.tpodt@gmail.com>
This commit is contained in:
Duncan Ogilvie 2019-01-04 16:58:11 +01:00 committed by Andrew Eikum
parent a14f231bd1
commit 01c0124bde
21 changed files with 357 additions and 356 deletions

View file

@ -10,6 +10,7 @@ import sys
import clang.cindex
import os
import re
import math
sdk_versions = [
"142",
@ -418,7 +419,7 @@ def handle_method(cfile, classname, winclassname, cppname, method, cpp, cpp_h, e
parambytes = 4 #_this
for param in list(method.get_children()):
if param.kind == clang.cindex.CursorKind.PARM_DECL:
parambytes += param.type.get_size()
parambytes += int(math.ceil(param.type.get_size()/4.0) * 4)
cfile.write("DEFINE_THISCALL_WRAPPER(%s_%s, %s)\n" % (winclassname, used_name, parambytes))
cpp_h.write("extern ")
if method.result_type.spelling.startswith("ISteam"):