Module Name:    src
Committed By:   kamil
Date:           Sat Aug 10 11:20:50 UTC 2019

Modified Files:
        src/sys/sys: event.h

Log Message:
Add fallback defintion for C++ of _EV_SET with the last argument of type 0

Converting 0 to intptr and void* is ambiguous according to a C++ compiler.
New _EV_SET() accepts int type and casts it with static_cast<int>() to
intptr_t.

Reported and fix tested by <John D. Baker>


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/sys/event.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/sys/event.h
diff -u src/sys/sys/event.h:1.33 src/sys/sys/event.h:1.34
--- src/sys/sys/event.h:1.33	Tue Aug  6 11:21:59 2019
+++ src/sys/sys/event.h	Sat Aug 10 11:20:50 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: event.h,v 1.33 2019/08/06 11:21:59 kamil Exp $	*/
+/*	$NetBSD: event.h,v 1.34 2019/08/10 11:20:50 kamil Exp $	*/
 
 /*-
  * Copyright (c) 1999,2000,2001 Jonathan Lemon <jle...@freebsd.org>
@@ -79,6 +79,14 @@ _EV_SET(struct kevent *_kevp, uintptr_t 
 	_EV_SET(_kevp, _ident, _filter, _flags, _fflags, _data,
 	    reinterpret_cast<intptr_t>(_udata));
 }
+
+static __inline void
+_EV_SET(struct kevent *_kevp, uintptr_t _ident, uint32_t _filter,
+    uint32_t _flags, uint32_t _fflags, int64_t _data, int _udata)
+{
+	_EV_SET(_kevp, _ident, _filter, _flags, _fflags, _data,
+	    static_cast<intptr_t>(_udata));
+}
 #else
 #define EV_SET(kevp, ident, filter, flags, fflags, data, udata)	\
     _EV_SET((kevp), __CAST(uintptr_t, (ident)), (filter), (flags), \

Reply via email to