summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--cpukit/include/sys/event.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/cpukit/include/sys/event.h b/cpukit/include/sys/event.h
index 92f4f57ce2..b3ba98dd5d 100644
--- a/cpukit/include/sys/event.h
+++ b/cpukit/include/sys/event.h
@@ -49,6 +49,25 @@
#define EVFILT_EMPTY (-13) /* empty send socket buf */
#define EVFILT_SYSCOUNT 13
+#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+#define EV_SET(kevp_, a, b, c, d, e, f) do { \
+ *(kevp_) = (struct kevent){ \
+ .ident = (a), \
+ .filter = (b), \
+ .flags = (c), \
+ .fflags = (d), \
+ .data = (e), \
+ .udata = (f), \
+ .ext[0] = 0, \
+ .ext[1] = 0, \
+ .ext[2] = 0, \
+ .ext[3] = 0, \
+ }; \
+} while(0)
+#else /* Pre-C99 or not STDC (e.g., C++) */
+/* The definition of the local variable kevp could possibly conflict
+ * with a user-defined value passed in parameters a-f.
+ */
#define EV_SET(kevp_, a, b, c, d, e, f) do { \
struct kevent *kevp = (kevp_); \
(kevp)->ident = (a); \
@@ -62,6 +81,7 @@
(kevp)->ext[2] = 0; \
(kevp)->ext[3] = 0; \
} while(0)
+#endif
struct kevent {
__uintptr_t ident; /* identifier for this event */