Skip to content

Commit efaf1fb

Browse files
committed
runtime: add a workaround for Windows build
The runtime tests will statically link the runtime and dynamically link to the standard library. This fails to build on Windows. This is a horrible workaround for the time being.
1 parent f302da0 commit efaf1fb

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

stdlib/public/runtime/MetadataLookup.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -730,8 +730,14 @@ _findContextDescriptorInCache(TypeMetadataPrivateState &T,
730730
$sS ## CHAR ## SUFFIX
731731
#define DESCRIPTOR_MANGLING(CHAR, SUFFIX) DESCRIPTOR_MANGLING_(CHAR, SUFFIX)
732732

733+
#if defined(_WIN32)
734+
#define swiftCore_EXPORTS __declspec(dllimport)
735+
#else
736+
#define swiftCore_EXPORTS
737+
#endif
738+
733739
#define STANDARD_TYPE(KIND, MANGLING, TYPENAME) \
734-
extern "C" const ContextDescriptor DESCRIPTOR_MANGLING(MANGLING, DESCRIPTOR_MANGLING_SUFFIX(KIND));
740+
extern "C" swiftCore_EXPORTS const ContextDescriptor DESCRIPTOR_MANGLING(MANGLING, DESCRIPTOR_MANGLING_SUFFIX(KIND));
735741

736742
#if !SWIFT_OBJC_INTEROP
737743
# define OBJC_INTEROP_STANDARD_TYPE(KIND, MANGLING, TYPENAME)

0 commit comments

Comments
 (0)