Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/sys Convert EV_SET(2) back into macro again



details:   https://anonhg.NetBSD.org/src/rev/b7152da6605f
branches:  trunk
changeset: 824360:b7152da6605f
user:      kamil <kamil%NetBSD.org@localhost>
date:      Fri Jun 02 19:44:06 2017 +0000

description:
Convert EV_SET(2) back into macro again

This retains compatibility with other moder BSDs if someone uses:
"#ifdef EV_SET".

This code also casts the last parameter to intptr_t, as other BSDs keep
this argument with a different type void*.

This change renames function EV_SET to EV_SET_, and calls it from EV_SET().

Credit to <christos> and <kre> for feedback.

Sponsored by <The NetBSD Foundation>

diffstat:

 sys/sys/event.h |  7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diffs (22 lines):

diff -r f3edee9ffefd -r b7152da6605f sys/sys/event.h
--- a/sys/sys/event.h   Fri Jun 02 19:35:54 2017 +0000
+++ b/sys/sys/event.h   Fri Jun 02 19:44:06 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: event.h,v 1.27 2017/05/31 00:45:59 kamil Exp $ */
+/*     $NetBSD: event.h,v 1.28 2017/06/02 19:44:06 kamil Exp $ */
 
 /*-
  * Copyright (c) 1999,2000,2001 Jonathan Lemon <jlemon%FreeBSD.org@localhost>
@@ -54,8 +54,11 @@
        intptr_t        udata;          /* opaque user data identifier */
 };
 
+#define EV_SET(kevp, a, b, c, d, e, f)                                 \
+       EV_SET_((kevp), (a), (b), (c), (d), (e), __CAST(intptr_t, (f)))
+
 static __inline void
-EV_SET(struct kevent *_kevp, uintptr_t _ident, uint32_t _filter,
+EV_SET_(struct kevent *_kevp, uintptr_t _ident, uint32_t _filter,
        uint32_t _flags, uint32_t _fflags, int64_t _data, intptr_t _udata)
 {
        _kevp->ident = _ident;



Home | Main Index | Thread Index | Old Index