Skip to content

Commit ac57b66

Browse files
authored
Merge pull request #6820 from hughbe/extern-c
Introduce SWIFT_EXTERN_RUNTIME_EXPORT for Windows
2 parents 8d61176 + a5a4880 commit ac57b66

34 files changed

+346
-408
lines changed

include/swift/Runtime/Debug.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,6 @@ swift_dynamicCastFailure(const void *sourceType, const char *sourceName,
110110
const char *message = nullptr);
111111

112112
SWIFT_RUNTIME_EXPORT
113-
extern "C"
114113
void swift_reportError(uint32_t flags, const char *message);
115114

116115
// namespace swift

include/swift/Runtime/Enum.h

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,9 @@ struct TypeLayout;
4141
/// \param payload - type metadata for the payload case of the enum.
4242
/// \param emptyCases - the number of empty cases in the enum.
4343
SWIFT_RUNTIME_EXPORT
44-
extern "C" void swift_initEnumValueWitnessTableSinglePayload(
45-
ValueWitnessTable *vwtable,
46-
const TypeLayout *payload,
47-
unsigned emptyCases);
44+
void swift_initEnumValueWitnessTableSinglePayload(ValueWitnessTable *vwtable,
45+
const TypeLayout *payload,
46+
unsigned emptyCases);
4847

4948
/// \brief Faster variant of the above which avoids digging into the enum type
5049
/// metadata when the caller already has the payload information handy.
@@ -57,9 +56,9 @@ extern "C" void swift_initEnumValueWitnessTableSinglePayload(
5756
/// returns a value greater than or equal to zero and less than
5857
/// emptyCases.
5958
SWIFT_RT_ENTRY_VISIBILITY
60-
extern "C" int swift_getEnumCaseSinglePayload(const OpaqueValue *value,
61-
const Metadata *payload,
62-
unsigned emptyCases)
59+
int swift_getEnumCaseSinglePayload(const OpaqueValue *value,
60+
const Metadata *payload,
61+
unsigned emptyCases)
6362
SWIFT_CC(RegisterPreservingCC);
6463

6564

@@ -76,19 +75,19 @@ extern "C" int swift_getEnumCaseSinglePayload(const OpaqueValue *value,
7675
/// than emptyCases for an empty case.
7776
/// \param emptyCases - the number of empty cases in the enum.
7877
SWIFT_RT_ENTRY_VISIBILITY
79-
extern "C" void swift_storeEnumTagSinglePayload(OpaqueValue *value,
80-
const Metadata *payload,
81-
int whichCase,
82-
unsigned emptyCases)
78+
void swift_storeEnumTagSinglePayload(OpaqueValue *value,
79+
const Metadata *payload,
80+
int whichCase,
81+
unsigned emptyCases)
8382
SWIFT_CC(RegisterPreservingCC);
8483

8584
/// \brief Initialize the value witness table for a generic, multi-payload
8685
/// enum instance.
8786
SWIFT_RUNTIME_EXPORT
88-
extern "C" void swift_initEnumMetadataMultiPayload(ValueWitnessTable *vwtable,
89-
EnumMetadata *enumType,
90-
unsigned numPayloads,
91-
const TypeLayout * const *payloadTypes);
87+
void swift_initEnumMetadataMultiPayload(ValueWitnessTable *vwtable,
88+
EnumMetadata *enumType,
89+
unsigned numPayloads,
90+
const TypeLayout * const *payloadTypes);
9291

9392
/// \brief Return an integer value representing which case of a multi-payload
9493
/// enum is inhabited.
@@ -98,15 +97,15 @@ extern "C" void swift_initEnumMetadataMultiPayload(ValueWitnessTable *vwtable,
9897
///
9998
/// \returns The index of the enum case.
10099
SWIFT_RUNTIME_EXPORT
101-
extern "C" unsigned swift_getEnumCaseMultiPayload(const OpaqueValue *value,
102-
const EnumMetadata *enumType);
100+
unsigned swift_getEnumCaseMultiPayload(const OpaqueValue *value,
101+
const EnumMetadata *enumType);
103102

104103
/// \brief Store the tag value for the given case into a multi-payload enum,
105104
/// whose associated payload (if any) has already been initialized.
106105
SWIFT_RUNTIME_EXPORT
107-
extern "C" void swift_storeEnumTagMultiPayload(OpaqueValue *value,
108-
const EnumMetadata *enumType,
109-
unsigned whichCase);
106+
void swift_storeEnumTagMultiPayload(OpaqueValue *value,
107+
const EnumMetadata *enumType,
108+
unsigned whichCase);
110109

111110
}
112111

0 commit comments

Comments
 (0)