Skip to content

Commit e3652d6

Browse files
committed
Expand comments and reorganize; remove mistaken redefine of DISPATCH_EXPORT macros
1 parent dd656be commit e3652d6

File tree

1 file changed

+13
-18
lines changed

1 file changed

+13
-18
lines changed

os/linux_base.h

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,18 @@ typedef void (*dispatch_mach_handler_function_t)(void*, dispatch_mach_reason_t,
6969

7070
typedef void (*dispatch_mach_msg_destructor_t)(void*);
7171

72+
typedef uint32_t voucher_activity_mode_t;
73+
74+
struct voucher_offsets_s {
75+
uint32_t vo_version;
76+
};
77+
78+
7279
/*
7380
* Stub out defines for other missing types
7481
*/
7582

83+
// Pulled from OS X man page for kevent
7684
struct kevent64_s {
7785
uint64_t ident; /* identifier for this event */
7886
int16_t filter; /* filter for event */
@@ -83,17 +91,13 @@ struct kevent64_s {
8391
uint64_t ext[2]; /* filter-specific extensions */
8492
};
8593

86-
typedef uint32_t voucher_activity_mode_t;
87-
88-
struct voucher_offsets_s {
89-
uint32_t vo_version;
90-
};
91-
9294

93-
// bogus...
95+
// PAGE_SIZE and SIZE_T_MAX should not be hardcoded like this here.
9496
#define PAGE_SIZE (4096)
9597
#define SIZE_T_MAX (0x7fffffff)
9698

99+
// Define to 0 the NOTE_ values that are not present on Linux.
100+
// Revisit this...would it be better to ifdef out the uses instead??
97101
#define NOTE_VM_PRESSURE 0
98102
#define NOTE_ABSOLUTE 0
99103
#define NOTE_NSECONDS 0
@@ -110,16 +114,6 @@ struct voucher_offsets_s {
110114
#endif
111115
#define OS_EXPORT
112116

113-
#ifdef DISPATCH_EXPORT
114-
#undef DISPATCH_EXPORT
115-
#endif
116-
#define DISPATCH_EXPORT
117-
118-
#ifdef DISPATCH_NONNULL_ALL
119-
#undef DISPATCH_NONNULL_ALL
120-
#endif
121-
#define DISPATCH_NONNULL_ALL
122-
123117
#ifdef OS_WARN_RESULT_NEEDS_RELEASE
124118
#undef OS_WARN_RESULT_NEEDS_RELEASE
125119
#endif
@@ -135,7 +129,8 @@ struct voucher_offsets_s {
135129
#define OS_NOTHROW
136130

137131

138-
// NOTE (Dave), these and similar macros come from Availabity.h on OS X
132+
// These and similar macros come from Availabilty.h on OS X
133+
// Need a better way to do this long term.
139134
#define __OSX_AVAILABLE_BUT_DEPRECATED(a,b,c,d) //
140135
#define __OSX_AVAILABLE_BUT_DEPRECATED_MSG(a,b,c,d,msg) //
141136

0 commit comments

Comments
 (0)