Skip to content

Commit 5ee237f

Browse files
authored
Merge pull request #106 from dgrove-oss/dispatch-stubs-fixme
define SWIFT_CC(swift) macro for DispatchStubs
2 parents 6ae05eb + 387ad7c commit 5ee237f

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/swift/DispatchStubs.cc

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,16 @@ static void _dispatch_overlay_constructor() {
5151

5252
#endif /* USE_OBJC */
5353

54-
#if 0 /* FIXME -- adding directory to include path may need build-script plumbing to do properly... */
55-
#include "swift/Runtime/Config.h"
54+
55+
// Replicate the SWIFT_CC(swift) calling convention macro from
56+
// swift/include/swift/Runtime/Config.h because it is
57+
// quite awkward to include Config.h and its recursive includes
58+
// in dispatch. This define must be manually kept in synch
59+
#define SWIFT_CC(CC) SWIFT_CC_##CC
60+
#if SWIFT_USE_SWIFTCALL
61+
#define SWIFT_CC_swift __attribute__((swiftcall))
5662
#else
57-
#define SWIFT_CC(x) /* FIXME!! */
63+
#define SWIFT_CC_swift
5864
#endif
5965

6066
SWIFT_CC(swift) DISPATCH_RUNTIME_STDLIB_INTERFACE

0 commit comments

Comments
 (0)