Skip to content

Commit dcac08b

Browse files
compnerdktopley-apple
authored andcommitted
unformalized windows patches for enumerations
Windows uses signed enumerations by default rather than unsigned. This results in the values triggering warnings on Windows. Signed-off-by: Daniel A. Steffen <dsteffen@apple.com>
1 parent c569e4e commit dcac08b

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

dispatch/base.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@
208208
#endif
209209
#endif
210210

211-
#if __has_feature(objc_fixed_enum) || __has_extension(cxx_strong_enums)
211+
#if __has_feature(objc_fixed_enum) || __has_extension(cxx_strong_enums) || defined(_WIN32)
212212
#define DISPATCH_ENUM(name, type, ...) \
213213
typedef enum : type { __VA_ARGS__ } name##_t
214214
#else

src/object_internal.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ DISPATCH_ENUM(dispatch_invoke_flags, uint32_t,
340340
#define _DISPATCH_INVOKE_AUTORELEASE_MASK 0x00300000u
341341
);
342342

343-
enum {
343+
DISPATCH_ENUM(dispatch_object_flags, unsigned long,
344344
_DISPATCH_META_TYPE_MASK = 0xffff0000, // mask for object meta-types
345345
_DISPATCH_TYPEFLAGS_MASK = 0x0000ff00, // mask for object typeflags
346346
_DISPATCH_SUB_TYPE_MASK = 0x000000ff, // mask for object sub-types
@@ -387,7 +387,7 @@ enum {
387387
DISPATCH_SOURCE_KEVENT_TYPE = 1 | _DISPATCH_SOURCE_TYPE,
388388
DISPATCH_MACH_CHANNEL_TYPE = 2 | _DISPATCH_SOURCE_TYPE,
389389

390-
};
390+
);
391391

392392
typedef struct _os_object_vtable_s {
393393
_OS_OBJECT_CLASS_HEADER();

0 commit comments

Comments
 (0)