Explorar el Código

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

gingerBill hace 4 años
padre
commit
e0ee59084e
Se han modificado 1 ficheros con 6 adiciones y 0 borrados
  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;
 }