Skip to content

Commit f932a06

Browse files
committed
merge darwin/darwin-006
2 parents 8976101 + cf8aae4 commit f932a06

33 files changed

+575
-394
lines changed

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: 1 addition & 1 deletion
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>]])

dispatch/Makefile.am

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,5 @@ dispatch_HEADERS= \
2424
time.h
2525

2626
if HAVE_SWIFT
27-
dispatch_HEADERS+=module.modulemap
27+
dispatch_HEADERS+=module.map
2828
endif

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/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

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.

dispatch/module.map

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
module Dispatch {
2+
requires blocks
3+
export *
4+
link "dispatch"
5+
link "BlocksRuntime"
6+
}
7+
8+
module DispatchIntrospection [system] [extern_c] {
9+
header "introspection.h"
10+
export *
11+
}
12+
13+
module CDispatch [system] [extern_c] {
14+
umbrella header "dispatch.h"
15+
module * { export * }
16+
export *
17+
requires blocks
18+
link "dispatch"
19+
link "BlocksRuntime"
20+
}

dispatch/module.modulemap

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,10 @@
1-
module Dispatch {
2-
requires blocks
1+
module Dispatch [system] [extern_c] {
2+
umbrella header "dispatch.h"
3+
module * { export * }
34
export *
4-
link "dispatch"
5-
link "BlocksRuntime"
65
}
76

87
module DispatchIntrospection [system] [extern_c] {
98
header "introspection.h"
109
export *
1110
}
12-
13-
module CDispatch [system] [extern_c] {
14-
umbrella header "dispatch.h"
15-
module * { export * }
16-
export *
17-
requires blocks
18-
link "dispatch"
19-
link "BlocksRuntime"
20-
}

man/dispatch_source_create.3

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -271,8 +271,8 @@ Sources of this type allow applications to manually trigger the source's event
271271
handler via a call to
272272
.Fn dispatch_source_merge_data .
273273
The data will be merged with the source's pending data via an atomic add or
274-
logic OR (based on the source's type), and the event handler block will be
275-
submitted to the source's target queue. The
274+
atomic bitwise OR (based on the source's type), and the event handler block will
275+
be submitted to the source's target queue. The
276276
.Fa data
277277
is application defined. These sources have no
278278
.Fa handle
@@ -297,7 +297,8 @@ The data returned by
297297
.Fn dispatch_source_get_data
298298
indicates which of the events in the
299299
.Fa mask
300-
were observed. Note that because this source type will request notifications on the provided port, it should not be mixed with the use of
300+
were observed. Note that because this source type will request notifications on
301+
the provided port, it should not be mixed with the use of
301302
.Fn mach_port_request_notification
302303
on the same port.
303304
.Pp
@@ -314,8 +315,8 @@ on the mach port is waiting to be received.
314315
.Pp
315316
.Vt DISPATCH_SOURCE_TYPE_MEMORYPRESSURE
316317
.Pp
317-
Sources of this type monitor the system memory pressure condition for state changes.
318-
The
318+
Sources of this type monitor the system memory pressure condition for state
319+
changes. The
319320
.Fa handle
320321
is unused and should be zero. The
321322
.Fa mask

0 commit comments

Comments
 (0)