Fix nethost.h header file when consuming as a static lib. (#35373)
authorAaron Robinson <arobins@microsoft.com>
Fri, 24 Apr 2020 02:53:07 +0000 (19:53 -0700)
committerGitHub <noreply@github.com>
Fri, 24 Apr 2020 02:53:07 +0000 (19:53 -0700)
src/installer/corehost/cli/nethost/nethost.h

index 839a3fd..42498ea 100644 (file)
@@ -7,11 +7,17 @@
 
 #include <stddef.h>
 
-#if defined(_WIN32)
+#ifdef _WIN32
     #ifdef NETHOST_EXPORT
         #define NETHOST_API __declspec(dllexport)
     #else
-        #define NETHOST_API __declspec(dllimport)
+        // Consuming the nethost as a static library
+        // Shouldn't export attempt to dllimport.
+        #ifdef NETHOST_USE_AS_STATIC
+            #define NETHOST_API 
+        #else
+            #define NETHOST_API __declspec(dllimport)
+        #endif
     #endif
 
     #define NETHOST_CALLTYPE __stdcall