Skip to content

Commit 8c5a6af

Browse files
committed
Use SWIFT_SDK_OVERLAY_DISPATCH_EPOCH to detect that an overlay is being built
Instead of defining the special macro __DISPATCH_BUILDING_SWIFT_MODULE__ to detect that dispatch headers are being processed by the clang importer, check to see if SWIFT_SDK_OVERLAY_DISPATCH_EPOCH is defined.
1 parent 5b893c8 commit 8c5a6af

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

dispatch/dispatch.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@
4444
#endif
4545

4646
#ifdef __linux__
47-
#ifdef __DISPATCH_BUILDING_SWIFT_MODULE__
48-
#include <stdio.h> // for off_t
47+
#ifdef SWIFT_SDK_OVERLAY_DISPATCH_EPOCH
48+
#include <stdio.h> // for off_t (to match Glibc.modulemap)
4949
#endif
5050
#define DISPATCH_LINUX_UNAVAILABLE() \
5151
__DISPATCH_UNAVAILABLE("This interface is unavailable on linux systems")

dispatch/object.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ typedef union {
108108
#define DISPATCH_RETURNS_RETAINED
109109
#endif
110110

111-
#if OS_OBJECT_SWIFT3
111+
#if OS_OBJECT_SWIFT3 && OS_OBJECT_USE_OBJC
112112
#define DISPATCH_SOURCE_TYPE_DECL(name) \
113113
DISPATCH_EXPORT struct dispatch_source_type_s \
114114
_dispatch_source_type_##name; \

src/Makefile.am

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ SWIFT_GEN_FILES= \
149149
$(SWIFT_OBJ_FILES:%=%.~partial.swiftdoc) \
150150
$(SWIFT_OBJ_FILES:%=%.~partial.swiftdeps)
151151

152-
SWIFTC_FLAGS = -Xcc -D__DISPATCH_BUILDING_SWIFT_MODULE__=1 -Xcc -fmodule-map-file=$(abs_top_srcdir)/dispatch/module.modulemap -I$(abs_top_srcdir) -Xcc -fblocks
152+
SWIFTC_FLAGS = -Xcc -fmodule-map-file=$(abs_top_srcdir)/dispatch/module.modulemap -I$(abs_top_srcdir) -Xcc -fblocks
153153

154154
$(abs_builddir)/swift/%.o: $(abs_srcdir)/swift/%.swift
155155
$(SWIFTC) -frontend -c $(SWIFT_ABS_SRC_FILES) -primary-file $< \

0 commit comments

Comments
 (0)