Skip to content

Commit 7563bdf

Browse files
authored
Merge pull request #143 from apple/das-darwin-006-merge-swift-3.0-branch
Merge darwin/trunk, including libdispatch-703.1.4 Apple source drop, to swift-3.0-branch
2 parents a2ba09f + 12e8a1b commit 7563bdf

39 files changed

+603
-385
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,5 @@ config
2929
configure
3030
libtool
3131
.dirstamp
32+
/dispatch/module.modulemap
33+
/private/module.modulemap

PATCHES

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,3 +241,29 @@ github commits starting with 29bdc2f from
241241
[4a6ec51] APPLIED rdar://25159995
242242
[bc16cc9] APPLIED rdar://25159995
243243
[954ace4] APPLIED rdar://25159995
244+
[5ea30b5] APPLIED rdar://26822213
245+
[9f1e778] APPLIED rdar://26822213
246+
[3339b81] APPLIED rdar://26822213
247+
[4fa8d8d] APPLIED rdar://26822213
248+
[e922531] APPLIED rdar://26822213
249+
[195cbcf] APPLIED rdar://27303844
250+
[5b893c8] APPLIED rdar://27303844
251+
[92689ed] APPLIED rdar://27303844
252+
[ecc14fa] APPLIED rdar://27303844
253+
[2dbf83c] APPLIED rdar://27303844
254+
[78b9e82] APPLIED rdar://27303844
255+
[2c0e5ee] APPLIED rdar://27303844
256+
[5ee237f] APPLIED rdar://27600964
257+
[77299ec] APPLIED rdar://27600964
258+
[57c5c28] APPLIED rdar://27600964
259+
[f8423ec] APPLIED rdar://27600964
260+
[325f73d] APPLIED rdar://27600964
261+
[b84e87e] APPLIED rdar://27600964
262+
[ae71a91] APPLIED rdar://27600964
263+
[8669dea] APPLIED rdar://27600964
264+
[a8d0327] APPLIED rdar://27600964
265+
[2e4e6af] APPLIED rdar://27600964
266+
[2457fb2] APPLIED rdar://27600964
267+
[4d58038] APPLIED rdar://27600964
268+
[98d0a05] APPLIED rdar://27600964
269+
[8976101] APPLIED rdar://27600964

config/config.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313
don't. */
1414
#define HAVE_DECL_FD_COPY 1
1515

16+
/* Define to 1 if you have the declaration of `NOTE_LOWAT', and to 0 if you
17+
don't. */
18+
#define HAVE_DECL_NOTE_LOWAT 1
19+
1620
/* Define to 1 if you have the declaration of `NOTE_NONE', and to 0 if you
1721
don't. */
1822
#define HAVE_DECL_NOTE_NONE 1

configure.ac

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ AC_CHECK_FUNCS([mach_port_construct])
353353
#
354354
AC_CHECK_DECLS([CLOCK_UPTIME, CLOCK_MONOTONIC], [], [],
355355
[[#include <time.h>]])
356-
AC_CHECK_DECLS([NOTE_NONE, NOTE_REAP, NOTE_REVOKE, NOTE_SIGNAL], [], [],
356+
AC_CHECK_DECLS([NOTE_NONE, NOTE_REAP, NOTE_REVOKE, NOTE_SIGNAL, NOTE_LOWAT], [], [],
357357
[[#include <sys/event.h>]])
358358
AC_CHECK_DECLS([FD_COPY], [], [], [[#include <sys/select.h>]])
359359
AC_CHECK_DECLS([SIGEMT], [], [], [[#include <signal.h>]])
@@ -432,6 +432,20 @@ AS_IF([test "x$have_mach" = "xtrue"], [
432432
])
433433
AM_CONDITIONAL(HAVE_DARWIN_LD, [test "x$dispatch_cv_ld_darwin" == "xyes"])
434434

435+
#
436+
# symlink platform-specific module.modulemap files
437+
#
438+
AS_CASE([$target_os],
439+
[darwin*], [ dispatch_module_map_os=darwin ],
440+
[ dispatch_module_map_os=generic ]
441+
)
442+
AC_CONFIG_COMMANDS([modulemaps], [
443+
ln -fs $dispatch_module_map_os/module.modulemap $ac_top_srcdir/dispatch/module.modulemap
444+
ln -fs $dispatch_module_map_os/module.modulemap $ac_top_srcdir/private/module.modulemap
445+
],
446+
[dispatch_module_map_os="$dispatch_module_map_os"]
447+
)
448+
435449
#
436450
# Temporary: some versions of clang do not mark __builtin_trap() as
437451
# __attribute__((__noreturn__)). Detect and add if required.
@@ -449,6 +463,6 @@ AC_CONFIG_FILES([Makefile dispatch/Makefile man/Makefile os/Makefile private/Mak
449463
#
450464
# Generate testsuite links
451465
#
452-
AC_CONFIG_LINKS([tests/dispatch:$top_srcdir/private tests/leaks-wrapper:tests/leaks-wrapper.sh])
466+
AC_CONFIG_LINKS([tests/dispatch:$ac_top_srcdir/private tests/leaks-wrapper:tests/leaks-wrapper.sh])
453467

454468
AC_OUTPUT

dispatch/base.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464
#define DISPATCH_MALLOC __attribute__((__malloc__))
6565
#define DISPATCH_ALWAYS_INLINE __attribute__((__always_inline__))
6666
#define DISPATCH_UNAVAILABLE __attribute__((__unavailable__))
67+
#define DISPATCH_UNAVAILABLE_MSG(msg) __attribute__((__unavailable__(msg)))
6768
#else
6869
/*! @parseOnly */
6970
#define DISPATCH_NORETURN
@@ -99,6 +100,16 @@
99100
#define DISPATCH_ALWAYS_INLINE
100101
/*! @parseOnly */
101102
#define DISPATCH_UNAVAILABLE
103+
/*! @parseOnly */
104+
#define DISPATCH_UNAVAILABLE_MSG(msg)
105+
#endif
106+
107+
#ifdef __linux__
108+
#define DISPATCH_LINUX_UNAVAILABLE() \
109+
DISPATCH_UNAVAILABLE_MSG( \
110+
"This interface is unavailable on linux systems")
111+
#else
112+
#define DISPATCH_LINUX_UNAVAILABLE()
102113
#endif
103114

104115
#ifndef DISPATCH_ALIAS_V2

dispatch/darwin/module.modulemap

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
module Dispatch [system] [extern_c] {
2+
umbrella header "dispatch.h"
3+
module * { export * }
4+
export *
5+
}
6+
7+
module DispatchIntrospection [system] [extern_c] {
8+
header "introspection.h"
9+
export *
10+
}

dispatch/dispatch.h

Lines changed: 16 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -24,71 +24,36 @@
2424
#ifdef __APPLE__
2525
#include <Availability.h>
2626
#include <TargetConditionals.h>
27-
#endif
28-
#include <sys/cdefs.h>
29-
#include <sys/types.h>
30-
#include <stddef.h>
31-
#include <stdint.h>
32-
#include <stdbool.h>
33-
#include <stdarg.h>
34-
#include <unistd.h>
35-
#include <fcntl.h>
36-
37-
#ifdef __has_attribute
38-
#if __has_attribute(unavailable)
39-
#define __DISPATCH_UNAVAILABLE(msg) __attribute__((__unavailable__(msg)))
40-
#endif
41-
#endif
42-
#ifndef __DISPATCH_UNAVAILABLE
43-
#define __DISPATCH_UNAVAILABLE(msg)
44-
#endif
45-
46-
#ifdef __linux__
47-
#if __has_feature(modules)
48-
#include <stdio.h> // for off_t (to match Glibc.modulemap)
49-
#endif
50-
#define DISPATCH_LINUX_UNAVAILABLE() \
51-
__DISPATCH_UNAVAILABLE("This interface is unavailable on linux systems")
5227
#else
53-
#define DISPATCH_LINUX_UNAVAILABLE()
54-
#endif
55-
56-
#ifndef __OSX_AVAILABLE_STARTING
5728
#define __OSX_AVAILABLE_STARTING(x, y)
58-
#endif
59-
#ifndef __OSX_AVAILABLE_BUT_DEPRECATED
6029
#define __OSX_AVAILABLE_BUT_DEPRECATED(...)
61-
#endif
62-
#ifndef __OSX_AVAILABLE_BUT_DEPRECATED_MSG
6330
#define __OSX_AVAILABLE_BUT_DEPRECATED_MSG(...)
64-
#endif
65-
66-
#ifndef __OSX_AVAILABLE
6731
#define __OSX_AVAILABLE(...)
68-
#endif
69-
#ifndef __IOS_AVAILABLE
7032
#define __IOS_AVAILABLE(...)
71-
#endif
72-
#ifndef __TVOS_AVAILABLE
7333
#define __TVOS_AVAILABLE(...)
74-
#endif
75-
#ifndef __WATCHOS_AVAILABLE
7634
#define __WATCHOS_AVAILABLE(...)
77-
#endif
78-
#ifndef __OSX_DEPRECATED
7935
#define __OSX_DEPRECATED(...)
80-
#endif
81-
#ifndef __IOS_DEPRECATED
8236
#define __IOS_DEPRECATED(...)
83-
#endif
84-
#ifndef __TVOS_DEPRECATED
8537
#define __TVOS_DEPRECATED(...)
86-
#endif
87-
#ifndef __WATCHOS_DEPRECATED
8838
#define __WATCHOS_DEPRECATED(...)
39+
#endif // __APPLE__
40+
41+
#include <sys/cdefs.h>
42+
#include <sys/types.h>
43+
#include <stddef.h>
44+
#include <stdint.h>
45+
#include <stdbool.h>
46+
#include <stdarg.h>
47+
#include <unistd.h>
48+
#include <fcntl.h>
49+
50+
#if defined(__linux__) && defined(__has_feature)
51+
#if __has_feature(modules)
52+
#include <stdio.h> // for off_t (to match Glibc.modulemap)
53+
#endif
8954
#endif
9055

91-
#define DISPATCH_API_VERSION 20160612
56+
#define DISPATCH_API_VERSION 20160712
9257

9358
#ifndef __DISPATCH_BUILDING_DISPATCH__
9459

File renamed without changes.

dispatch/group.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,7 @@ dispatch_group_async_f(dispatch_group_t group,
134134
* @discussion
135135
* This function waits for the completion of the blocks associated with the
136136
* given dispatch group, and returns after all blocks have completed or when
137-
* the specified timeout has elapsed. When a timeout occurs, the group is
138-
* restored to its original state.
137+
* the specified timeout has elapsed.
139138
*
140139
* This function will return immediately if there are no blocks associated
141140
* with the dispatch group (i.e. the group is empty).
@@ -262,7 +261,7 @@ dispatch_group_enter(dispatch_group_t group);
262261
*
263262
* @discussion
264263
* Calling this function indicates block has completed and left the dispatch
265-
* groupJ by a means other than dispatch_group_async().
264+
* group by a means other than dispatch_group_async().
266265
*
267266
* @param group
268267
* The dispatch group to update.

libdispatch.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -662,8 +662,8 @@
662662
C01866BD1C5973210040FC07 /* libdispatch.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libdispatch.a; sourceTree = BUILT_PRODUCTS_DIR; };
663663
C01866BE1C59735B0040FC07 /* libdispatch-mp-static.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "libdispatch-mp-static.xcconfig"; sourceTree = "<group>"; };
664664
C01866BF1C5976C90040FC07 /* run-on-install.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = "run-on-install.sh"; sourceTree = "<group>"; };
665-
C901445E1C73A7FE002638FC /* module.modulemap */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = "sourcecode.module-map"; path = module.modulemap; sourceTree = "<group>"; };
666-
C90144641C73A845002638FC /* module.modulemap */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = "sourcecode.module-map"; path = module.modulemap; sourceTree = "<group>"; };
665+
C901445E1C73A7FE002638FC /* module.modulemap */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = "sourcecode.module-map"; name = module.modulemap; path = darwin/module.modulemap; sourceTree = "<group>"; };
666+
C90144641C73A845002638FC /* module.modulemap */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = "sourcecode.module-map"; name = module.modulemap; path = darwin/module.modulemap; sourceTree = "<group>"; };
667667
C913AC0E143BD34800B78976 /* data_private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = data_private.h; sourceTree = "<group>"; tabWidth = 8; };
668668
C927F35F10FD7F1000C5AB8B /* ddt.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = ddt.xcodeproj; path = tools/ddt/ddt.xcodeproj; sourceTree = "<group>"; };
669669
C96CE17A1CEB851600F4B8E6 /* dispatch_objc.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = dispatch_objc.m; sourceTree = "<group>"; };

0 commit comments

Comments
 (0)