Add Visual Studio calling convention support

Add callingconvention directive, possible values are: Cdecl, FastCall, StdCall or VectorCall.
This commit is contained in:
Tim Wharton 2015-06-03 03:16:53 +01:00
parent 7965886fb0
commit fbd2d5d707
3 changed files with 24 additions and 1 deletions

View File

@ -466,6 +466,18 @@
}
}
api.register {
name = "callingconvention",
scope = "config",
kind = "string",
allowed = {
"Cdecl",
"FastCall",
"StdCall",
"VectorCall",
}
}
api.register {
name = "forceincludes",
scope = "config",

View File

@ -322,6 +322,7 @@
m.multiProcessorCompilation,
m.additionalCompileOptions,
m.compileAs,
m.callingConvention,
}
end
@ -1599,7 +1600,11 @@
end
end
function m.callingConvention(cfg)
if cfg.callingconvention then
p.w('<CallingConvention>%s</CallingConvention>', cfg.callingconvention)
end
end
function m.runtimeTypeInfo(cfg)
if cfg.flags.NoRTTI and cfg.clr == p.OFF then

View File

@ -46,6 +46,12 @@
Fast = "/fp:fast",
Strict = "/fp:strict",
},
callingconvention = {
Cdecl = "/Gd",
FastCall = "/Gr",
StdCall = "/Gz",
VectorCall = "/Gv",
},
optimize = {
Off = "/Od",
On = "/Ot",