aboutsummaryrefslogtreecommitdiffstats
path: root/system_cmds/lskq.tproj/common.h
diff options
context:
space:
mode:
Diffstat (limited to 'system_cmds/lskq.tproj/common.h')
-rw-r--r--system_cmds/lskq.tproj/common.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/system_cmds/lskq.tproj/common.h b/system_cmds/lskq.tproj/common.h
index 959ac66..c01cff4 100644
--- a/system_cmds/lskq.tproj/common.h
+++ b/system_cmds/lskq.tproj/common.h
@@ -26,6 +26,31 @@
#include <stdint.h>
+#ifndef __enum_open
+#if __has_attribute(enum_extensibility)
+#define __enum_open __attribute__((__enum_extensibility__(open)))
+#define __enum_closed __attribute__((__enum_extensibility__(closed)))
+#else
+#define __enum_open
+#define __enum_closed
+#endif // __has_attribute(enum_extensibility)
+#endif
+
+#ifndef __enum_options
+#if __has_attribute(flag_enum)
+#define __enum_options __attribute__((__flag_enum__))
+#else
+#define __enum_options
+#endif
+#endif
+
+#ifndef __enum_decl
+#define __enum_decl(_name, _type, ...) \
+ typedef _type _name; enum __VA_ARGS__ __enum_open
+#define __options_decl(_name, _type, ...) \
+ typedef _type _name; enum __VA_ARGS__ __enum_open __enum_options
+#endif
+
/*
* This file must be kept in sync with xnu headers
*/