mirror of
https://github.com/servo/servo.git
synced 2025-07-24 15:50:21 +01:00
Fix char types in script binding codegen
Use `libc::c_char` instead of `i8` for character data since that's more portable. (Some architectures, e.g. AArch64, have unsigned characters, i.e. `u8`.)
This commit is contained in:
parent
7fb3c51bbb
commit
8405ac70c9
1 changed files with 3 additions and 3 deletions
|
@ -1437,12 +1437,12 @@ class MethodDefiner(PropertyDefiner):
|
||||||
# TODO: Use something like JS_FNSPEC
|
# TODO: Use something like JS_FNSPEC
|
||||||
# https://github.com/servo/servo/issues/6391
|
# https://github.com/servo/servo/issues/6391
|
||||||
if "selfHostedName" in m:
|
if "selfHostedName" in m:
|
||||||
selfHostedName = '%s as *const u8 as *const i8' % str_to_const_array(m["selfHostedName"])
|
selfHostedName = '%s as *const u8 as *const libc::c_char' % str_to_const_array(m["selfHostedName"])
|
||||||
assert not m.get("methodInfo", True)
|
assert not m.get("methodInfo", True)
|
||||||
accessor = "None"
|
accessor = "None"
|
||||||
jitinfo = "0 as *const JSJitInfo"
|
jitinfo = "0 as *const JSJitInfo"
|
||||||
else:
|
else:
|
||||||
selfHostedName = "0 as *const i8"
|
selfHostedName = "0 as *const libc::c_char"
|
||||||
if m.get("methodInfo", True):
|
if m.get("methodInfo", True):
|
||||||
identifier = m.get("nativeName", m["name"])
|
identifier = m.get("nativeName", m["name"])
|
||||||
jitinfo = "&%s_methodinfo" % identifier
|
jitinfo = "&%s_methodinfo" % identifier
|
||||||
|
@ -1469,7 +1469,7 @@ class MethodDefiner(PropertyDefiner):
|
||||||
' call: JSNativeWrapper { op: None, info: 0 as *const JSJitInfo },\n'
|
' call: JSNativeWrapper { op: None, info: 0 as *const JSJitInfo },\n'
|
||||||
' nargs: 0,\n'
|
' nargs: 0,\n'
|
||||||
' flags: 0,\n'
|
' flags: 0,\n'
|
||||||
' selfHostedName: 0 as *const i8\n'
|
' selfHostedName: 0 as *const libc::c_char\n'
|
||||||
' }',
|
' }',
|
||||||
'JSFunctionSpec',
|
'JSFunctionSpec',
|
||||||
specData)
|
specData)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue