浏览代码

Add calling convention `"system"` which is an alias for `"stdcall"` on Windows and `"cdecl"` on other platforms

gingerBill 4 年之前
父节点
当前提交
e0ee59084e
共有 1 个文件被更改,包括 6 次插入0 次删除
  1. 6 0
      src/parser.cpp

+ 6 - 0
src/parser.cpp

@@ -3273,6 +3273,12 @@ ProcCallingConvention string_to_calling_convention(String s) {
 	if (s == "fast")        return ProcCC_FastCall;
 	if (s == "none")        return ProcCC_None;
 	if (s == "naked")       return ProcCC_Naked;
+	if (s == "system") {
+		if (build_context.metrics.os == TargetOs_windows) {
+			return ProcCC_StdCall;
+		}
+		return ProcCC_CDecl;
+	}
 	return ProcCC_Invalid;
 }