Source-Changes-HG archive

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

[src/trunk]: src/external/cddl/osnet/sys/sys tweak the osnet compat headers t...



details:   https://anonhg.NetBSD.org/src/rev/f5021d4ac68b
branches:  trunk
changeset: 319557:f5021d4ac68b
user:      chs <chs%NetBSD.org@localhost>
date:      Sun Jun 03 05:55:08 2018 +0000

description:
tweak the osnet compat headers to allow building on MacOS and Linux hosts.

diffstat:

 external/cddl/osnet/sys/sys/proc.h      |   4 +++-
 external/cddl/osnet/sys/sys/sysmacros.h |  18 +++++++++++++++++-
 external/cddl/osnet/sys/sys/time.h      |   7 ++++++-
 external/cddl/osnet/sys/sys/types.h     |   5 ++++-
 4 files changed, 30 insertions(+), 4 deletions(-)

diffs (124 lines):

diff -r a3627d2af80b -r f5021d4ac68b external/cddl/osnet/sys/sys/proc.h
--- a/external/cddl/osnet/sys/sys/proc.h        Sun Jun 03 05:29:27 2018 +0000
+++ b/external/cddl/osnet/sys/sys/proc.h        Sun Jun 03 05:55:08 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: proc.h,v 1.7 2018/06/02 18:46:34 christos Exp $        */
+/*     $NetBSD: proc.h,v 1.8 2018/06/03 05:55:08 chs Exp $     */
 
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -61,7 +61,9 @@
 #define        _OPENSOLARIS_SYS_PROC_H_
 
 #include_next <sys/proc.h>
+#ifdef __NetBSD__
 #include <sys/stdint.h>
+#endif
 
 #ifdef _KERNEL
 
diff -r a3627d2af80b -r f5021d4ac68b external/cddl/osnet/sys/sys/sysmacros.h
--- a/external/cddl/osnet/sys/sys/sysmacros.h   Sun Jun 03 05:29:27 2018 +0000
+++ b/external/cddl/osnet/sys/sys/sysmacros.h   Sun Jun 03 05:55:08 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sysmacros.h,v 1.8 2018/05/28 21:05:10 chs Exp $        */
+/*     $NetBSD: sysmacros.h,v 1.9 2018/06/03 05:55:08 chs Exp $        */
 
 /*
  * CDDL HEADER START
@@ -32,6 +32,16 @@
 #ifndef _SYS_SYSMACROS_H
 #define        _SYS_SYSMACROS_H
 
+/*
+ * Linux includes <sys/sysmacros.h> from <sys/types.h> with
+ * __SYSMACROS_DEPRECATED_INCLUSION defined during the include,
+ * but some of the definitions here break in that context,
+ * so if that symbol is defined then only define the few macros
+ * that we need there.
+ */
+
+#ifndef __SYSMACROS_DEPRECATED_INCLUSION
+
 #include <sys/param.h>
 #include <sys/opentypes.h>
 
@@ -52,6 +62,8 @@
 #define        btodt(BB)       ((BB) >> DEV_BSHIFT)
 #define        lbtod(BB)       (((offset_t)(BB) + DEV_BSIZE - 1) >> DEV_BSHIFT)
 
+#endif /* __SYSMACROS_DEPRECATED_INCLUSION */
+
 /* common macros */
 #ifndef MIN
 #define        MIN(a, b)       ((a) < (b) ? (a) : (b))
@@ -66,6 +78,8 @@
 #define        SIGNOF(a)       ((a) < 0 ? -1 : (a) > 0)
 #endif
 
+#ifndef __SYSMACROS_DEPRECATED_INCLUSION
+
 #ifdef _KERNEL
 
 /*
@@ -469,4 +483,6 @@
 }
 #endif
 
+#endif /* __SYSMACROS_DEPRECATED_INCLUSION */
+
 #endif /* _SYS_SYSMACROS_H */
diff -r a3627d2af80b -r f5021d4ac68b external/cddl/osnet/sys/sys/time.h
--- a/external/cddl/osnet/sys/sys/time.h        Sun Jun 03 05:29:27 2018 +0000
+++ b/external/cddl/osnet/sys/sys/time.h        Sun Jun 03 05:55:08 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: time.h,v 1.11 2018/06/02 18:46:34 christos Exp $       */
+/*     $NetBSD: time.h,v 1.12 2018/06/03 05:55:08 chs Exp $    */
 
 /*-
  * Copyright (c) 2007 Pawel Jakub Dawidek <pjd%FreeBSD.org@localhost>
@@ -92,8 +92,13 @@
 
 #else
 
+#ifdef __NetBSD__
 int clock_gettime(clockid_t, struct timespec *)
     __RENAME(__clock_gettime50);
+#endif
+#ifdef __linux__
+#include <time.h>
+#endif
 
 static __inline hrtime_t gethrtime(void) {
        struct timespec ts;
diff -r a3627d2af80b -r f5021d4ac68b external/cddl/osnet/sys/sys/types.h
--- a/external/cddl/osnet/sys/sys/types.h       Sun Jun 03 05:29:27 2018 +0000
+++ b/external/cddl/osnet/sys/sys/types.h       Sun Jun 03 05:55:08 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: types.h,v 1.19 2018/06/01 00:56:19 kre Exp $   */
+/*     $NetBSD: types.h,v 1.20 2018/06/03 05:55:08 chs Exp $   */
 
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -65,11 +65,13 @@
  */
 #define longlong_t __hide_longlong_t
 #define u_longlong_t __hide_u_longlong_t
+
 #ifndef _KERNEL
 #include <stdint.h>
 #else
 #include <sys/stdint.h>
 #endif
+
 #ifndef HAVE_NBTOOLS_CONFIG_H
 #ifdef _NETBSD_SOURCE
 #include_next <sys/types.h>
@@ -81,6 +83,7 @@
 #undef _NETBSD_SOURCE
 #endif
 #endif
+
 #undef longlong_t
 #undef u_longlong_t
 #ifndef __defined_ll_t



Home | Main Index | Thread Index | Old Index