From 7bb617ea6e4364720f16cea659ac4b2ca301a5a0 Mon Sep 17 00:00:00 2001 From: Aaron Robinson Date: Thu, 23 Apr 2020 19:53:07 -0700 Subject: [PATCH] Fix nethost.h header file when consuming as a static lib. (#35373) --- src/installer/corehost/cli/nethost/nethost.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/installer/corehost/cli/nethost/nethost.h b/src/installer/corehost/cli/nethost/nethost.h index 839a3fd..42498ea 100644 --- a/src/installer/corehost/cli/nethost/nethost.h +++ b/src/installer/corehost/cli/nethost/nethost.h @@ -7,11 +7,17 @@ #include -#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 -- 2.7.4