Decorate SuperPMI DllMain jitStartup getJit with DLLEXPORT (#24508)
authorEgor Chesakov <Egor.Chesakov@microsoft.com>
Tue, 14 May 2019 23:31:29 +0000 (16:31 -0700)
committerGitHub <noreply@github.com>
Tue, 14 May 2019 23:31:29 +0000 (16:31 -0700)
* Decorate DllMain with DLLEXPORT in superpmi-shim-collector.cpp superpmi-shim-counter.cpp superpmi-shim-simple.cpp

* Decorate jitStartup, getJit, sxsJitStartup with DLLEXPORT in superpmi-shim-collector.cpp superpmi-shim-counter.cpp superpmi-shim-simple.cpp

src/ToolBox/superpmi/superpmi-shim-collector/superpmi-shim-collector.cpp
src/ToolBox/superpmi/superpmi-shim-counter/superpmi-shim-counter.cpp
src/ToolBox/superpmi/superpmi-shim-simple/superpmi-shim-simple.cpp

index 9c2cdc3..4068dac 100644 (file)
@@ -86,10 +86,10 @@ void SetLogFilePath()
     }
 }
 
-extern "C" BOOL
-#ifndef FEATURE_PAL
-    APIENTRY
-#endif // !FEATURE_PAL
+#ifdef FEATURE_PAL
+DLLEXPORT // For Win32 PAL LoadLibrary emulation
+#endif
+    extern "C" BOOL
     DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved)
 {
     switch (ul_reason_for_call)
@@ -123,8 +123,7 @@ extern "C" BOOL
     return TRUE;
 }
 
-// Exported via def file
-extern "C" void __stdcall jitStartup(ICorJitHost* host)
+extern "C" DLLEXPORT void __stdcall jitStartup(ICorJitHost* host)
 {
     SetDefaultPaths();
     SetLibName();
@@ -147,8 +146,7 @@ extern "C" void __stdcall jitStartup(ICorJitHost* host)
     pnjitStartup(g_ourJitHost);
 }
 
-// Exported via def file
-extern "C" ICorJitCompiler* __stdcall getJit()
+extern "C" DLLEXPORT ICorJitCompiler* __stdcall getJit()
 {
     DWORD             dwRetVal = 0;
     PgetJit           pngetJit;
@@ -194,8 +192,7 @@ extern "C" ICorJitCompiler* __stdcall getJit()
     return pJitInstance;
 }
 
-// Exported via def file
-extern "C" void __stdcall sxsJitStartup(CoreClrCallbacks const& original_cccallbacks)
+extern "C" DLLEXPORT void __stdcall sxsJitStartup(CoreClrCallbacks const& original_cccallbacks)
 {
     PsxsJitStartup pnsxsJitStartup;
 
index 51d76b4..57a4ad6 100644 (file)
@@ -68,10 +68,10 @@ void SetLogFilePath()
     }
 }
 
-extern "C" BOOL
-#ifndef FEATURE_PAL
-    APIENTRY
-#endif // !FEATURE_PAL
+#ifdef FEATURE_PAL
+DLLEXPORT // For Win32 PAL LoadLibrary emulation
+#endif
+    extern "C" BOOL
     DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved)
 {
     switch (ul_reason_for_call)
@@ -110,8 +110,7 @@ extern "C" BOOL
     return TRUE;
 }
 
-// Exported via def file
-extern "C" void __stdcall jitStartup(ICorJitHost* host)
+extern "C" DLLEXPORT void __stdcall jitStartup(ICorJitHost* host)
 {
     SetDefaultPaths();
     SetLibName();
@@ -143,8 +142,7 @@ extern "C" void __stdcall jitStartup(ICorJitHost* host)
     pnjitStartup(g_ourJitHost);
 }
 
-// Exported via def file
-extern "C" ICorJitCompiler* __stdcall getJit()
+extern "C" DLLEXPORT ICorJitCompiler* __stdcall getJit()
 {
     DWORD             dwRetVal = 0;
     PgetJit           pngetJit;
@@ -186,8 +184,7 @@ extern "C" ICorJitCompiler* __stdcall getJit()
     return pJitInstance;
 }
 
-// Exported via def file
-extern "C" void __stdcall sxsJitStartup(CoreClrCallbacks const& original_cccallbacks)
+extern "C" DLLEXPORT void __stdcall sxsJitStartup(CoreClrCallbacks const& original_cccallbacks)
 {
     PsxsJitStartup pnsxsJitStartup;
 
index 1f446ca..01341cc 100644 (file)
@@ -58,10 +58,10 @@ void SetLogFilePath()
     }
 }
 
-extern "C" BOOL
-#ifndef FEATURE_PAL
-    APIENTRY
-#endif // !FEATURE_PAL
+#ifdef FEATURE_PAL
+DLLEXPORT // For Win32 PAL LoadLibrary emulation
+#endif
+    extern "C" BOOL
     DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved)
 {
     switch (ul_reason_for_call)
@@ -95,8 +95,7 @@ extern "C" BOOL
     return TRUE;
 }
 
-// Exported via def file
-extern "C" void __stdcall jitStartup(ICorJitHost* host)
+extern "C" DLLEXPORT void __stdcall jitStartup(ICorJitHost* host)
 {
     SetDefaultPaths();
     SetLibName();
@@ -119,8 +118,7 @@ extern "C" void __stdcall jitStartup(ICorJitHost* host)
     pnjitStartup(g_ourJitHost);
 }
 
-// Exported via def file
-extern "C" ICorJitCompiler* __stdcall getJit()
+extern "C" DLLEXPORT ICorJitCompiler* __stdcall getJit()
 {
     DWORD             dwRetVal = 0;
     PgetJit           pngetJit;
@@ -155,8 +153,7 @@ extern "C" ICorJitCompiler* __stdcall getJit()
     return pJitInstance;
 }
 
-// Exported via def file
-extern "C" void __stdcall sxsJitStartup(CoreClrCallbacks const& original_cccallbacks)
+extern "C" DLLEXPORT void __stdcall sxsJitStartup(CoreClrCallbacks const& original_cccallbacks)
 {
     PsxsJitStartup pnsxsJitStartup;