Skip to content

Commit 6fc5d79

Browse files
committed
unformalized windows patches for enumerations
Windows uses signed enumerations by default rather than unsigned. This results in the values triggering warnings on Windows.
1 parent e013bea commit 6fc5d79

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
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 & 3 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
@@ -386,8 +386,7 @@ enum {
386386

387387
DISPATCH_SOURCE_KEVENT_TYPE = 1 | _DISPATCH_SOURCE_TYPE,
388388
DISPATCH_MACH_CHANNEL_TYPE = 2 | _DISPATCH_SOURCE_TYPE,
389-
390-
};
389+
);
391390

392391
typedef struct _os_object_vtable_s {
393392
_OS_OBJECT_CLASS_HEADER();

0 commit comments

Comments
 (0)