Fix the stdcall to be present only for x86 Windows
authorJan Vorlicek <janvorli@microsoft.com>
Fri, 22 Feb 2019 23:19:23 +0000 (00:19 +0100)
committerJan Vorlicek <janvorli@microsoft.com>
Fri, 22 Feb 2019 23:19:23 +0000 (00:19 +0100)
src/coreclr/hosts/inc/coreclrhost.h

index 457d46b..534f94b 100644 (file)
@@ -9,12 +9,18 @@
 #ifndef __CORECLR_HOST_H__
 #define __CORECLR_HOST_H__
 
+#if defined(_WIN32) && defined(_M_IX86)
+#define CALLING_CONVENTION __stdcall
+#else
+#define CALLING_CONVENTION
+#endif
+
 // For each hosting API, we define a function prototype and a function pointer
 // The prototype is useful for implicit linking against the dynamic coreclr
 // library and the pointer for explicit dynamic loading (dlopen, LoadLibrary)
 #define CORECLR_HOSTING_API(function, ...) \
-    extern "C" int __stdcall function(__VA_ARGS__); \
-    typedef int (__stdcall *function##_ptr)(__VA_ARGS__)
+    extern "C" int CALLING_CONVENTION function(__VA_ARGS__); \
+    typedef int (CALLING_CONVENTION *function##_ptr)(__VA_ARGS__)
     
 //
 // Initialize the CoreCLR. Creates and starts CoreCLR host and creates an app domain