Skip to content

Commit bf1ab6c

Browse files
authored
Merge pull request #27196 from compnerd/27185
runtime: add a workaround for Windows build
2 parents 520527d + efaf1fb commit bf1ab6c

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)