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 Split the opensolaris types into...



details:   https://anonhg.NetBSD.org/src/rev/1ece2d668664
branches:  trunk
changeset: 343372:1ece2d668664
user:      christos <christos%NetBSD.org@localhost>
date:      Mon Feb 01 02:12:55 2016 +0000

description:
Split the opensolaris types into opentypes.h because linux includes
sysmacros.h from types.h and we can't interpose ourselves to define
the needed types otherwise.
Disable unused macros, get rid of __APPLE__

diffstat:

 external/cddl/osnet/sys/sys/opentypes.h |  76 ++++++++++++++++++++++++++++++++
 external/cddl/osnet/sys/sys/sysmacros.h |   5 +-
 external/cddl/osnet/sys/sys/types.h     |  78 ++------------------------------
 3 files changed, 84 insertions(+), 75 deletions(-)

diffs (215 lines):

diff -r ec8bb6689ecb -r 1ece2d668664 external/cddl/osnet/sys/sys/opentypes.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/external/cddl/osnet/sys/sys/opentypes.h   Mon Feb 01 02:12:55 2016 +0000
@@ -0,0 +1,76 @@
+#ifndef _OPENSOLARIS_SYS_OPENTYPES_H_
+#define _OPENSOLARIS_SYS_OPENTYPES_H_
+
+#define        MAXNAMELEN      256
+#define        FMNAMESZ        8
+
+#if defined(__APPLE__) || defined(HAVE_NBTOOL_CONFIG_H)
+typedef int64_t longlong_t;
+typedef uint64_t u_longlong_t;
+typedef unsigned long vsize_t;
+#endif
+
+typedef unsigned int   size32_t;
+typedef unsigned int   caddr32_t;
+
+typedef        struct timespec timestruc_t;
+typedef unsigned int   uint_t;
+typedef unsigned char  uchar_t;
+typedef unsigned short ushort_t;
+typedef unsigned long  ulong_t;
+typedef off_t          off64_t;
+typedef id_t           taskid_t;
+typedef id_t           projid_t;
+typedef id_t           poolid_t;
+typedef id_t           zoneid_t;
+typedef id_t           ctid_t;
+
+#define        B_FALSE 0
+#define        B_TRUE  1
+typedef int            boolean_t;
+
+typedef longlong_t      hrtime_t;
+typedef int32_t                t_scalar_t;
+typedef uint32_t       t_uscalar_t;
+#if defined(_KERNEL) || defined(_KERNTYPES)
+typedef vsize_t                pgcnt_t;
+#endif
+typedef u_longlong_t   len_t;
+typedef int            major_t;
+typedef int            minor_t;
+typedef int            o_uid_t;
+typedef int            o_gid_t;
+typedef struct kauth_cred cred_t;
+typedef uintptr_t      pc_t;
+typedef struct vm_page page_t;
+typedef        ushort_t        o_mode_t;       /* old file attribute type */
+typedef        u_longlong_t    diskaddr_t;
+typedef void           *zone_t;
+typedef struct vfsops  vfsops_t;
+
+#ifdef _KERNEL
+
+typedef        short           index_t;
+typedef        off_t           offset_t;
+typedef        int64_t         rlim64_t;
+typedef __caddr_t      caddr_t;        /* core address */
+
+#else
+
+typedef        longlong_t      offset_t;
+typedef        u_longlong_t    u_offset_t;
+typedef        uint64_t        upad64_t;
+typedef        struct timespec timespec_t;
+typedef        int32_t         daddr32_t;
+typedef        int32_t         time32_t;
+
+#endif /* !_KERNEL */
+
+#define        MAXOFFSET_T     0x7fffffffffffffffLL
+#define        seg_rw          uio_rw
+#define        S_READ          UIO_READ
+#define        S_WRITE         UIO_WRITE
+struct aio_req;
+typedef void           *dev_info_t;
+
+#endif /* _OPENSOLARIS_SYS_OPENTYPES_H_ */
diff -r ec8bb6689ecb -r 1ece2d668664 external/cddl/osnet/sys/sys/sysmacros.h
--- a/external/cddl/osnet/sys/sys/sysmacros.h   Mon Feb 01 02:09:54 2016 +0000
+++ b/external/cddl/osnet/sys/sys/sysmacros.h   Mon Feb 01 02:12:55 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sysmacros.h,v 1.6 2015/12/27 21:40:21 christos Exp $   */
+/*     $NetBSD: sysmacros.h,v 1.7 2016/02/01 02:12:55 christos Exp $   */
 
 /*
  * CDDL HEADER START
@@ -33,6 +33,7 @@
 #define        _SYS_SYSMACROS_H
 
 #include <sys/param.h>
+#include <sys/opentypes.h>
 
 #ifdef __cplusplus
 extern "C" {
@@ -348,7 +349,7 @@
  * because if a field crosses a byte boundary it's not likely to be meaningful
  * without reassembly in its nonnative endianness.
  */
-#if !defined(__NetBSD__) && !defined(__APPLE__)
+#ifdef notdef
 #if defined(_BIT_FIELDS_LTOH)
 #define        DECL_BITFIELD2(_a, _b)                          \
        uint8_t _a, _b
diff -r ec8bb6689ecb -r 1ece2d668664 external/cddl/osnet/sys/sys/types.h
--- a/external/cddl/osnet/sys/sys/types.h       Mon Feb 01 02:09:54 2016 +0000
+++ b/external/cddl/osnet/sys/sys/types.h       Mon Feb 01 02:12:55 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: types.h,v 1.16 2016/01/31 06:15:39 christos Exp $      */
+/*     $NetBSD: types.h,v 1.17 2016/02/01 02:12:55 christos Exp $      */
 
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -63,11 +63,12 @@
 /*
  * This is a bag of dirty hacks to keep things compiling.
  */
-#ifdef __APPLE__
+#ifndef _KERNEL
 #include <stdint.h>
 #else
 #include <sys/stdint.h>
 #endif
+#ifndef HAVE_NBTOOLS_CONFIG_H
 #ifdef _NETBSD_SOURCE
 #include_next <sys/types.h>
 #include_next <sys/ccompile.h>
@@ -77,6 +78,7 @@
 #include_next <sys/ccompile.h>
 #undef _NETBSD_SOURCE
 #endif
+#endif
 
 #ifndef _KERNEL
 #include <stdarg.h>
@@ -84,76 +86,6 @@
 #include <sys/stdarg.h>
 #endif
 
-#define        MAXNAMELEN      256
-#define        FMNAMESZ        8
-
-#ifdef __APPLE__
-typedef int64_t longlong_t;
-typedef uint64_t u_longlong_t;
-typedef unsigned long vsize_t;
-#endif
-
-typedef unsigned int   size32_t;
-typedef unsigned int   caddr32_t;
-
-typedef        struct timespec timestruc_t;
-typedef u_int          uint_t;
-typedef u_char         uchar_t;
-typedef u_short                ushort_t;
-typedef u_long         ulong_t;
-typedef off_t          off64_t;
-typedef id_t           taskid_t;
-typedef id_t           projid_t;
-typedef id_t           poolid_t;
-typedef id_t           zoneid_t;
-typedef id_t           ctid_t;
-
-#define        B_FALSE 0
-#define        B_TRUE  1
-typedef int            boolean_t;
-
-typedef longlong_t      hrtime_t;
-typedef int32_t                t_scalar_t;
-typedef uint32_t       t_uscalar_t;
-#if defined(_KERNEL) || defined(_KERNTYPES)
-typedef vsize_t                pgcnt_t;
-#endif
-typedef u_longlong_t   len_t;
-typedef int            major_t;
-typedef int            minor_t;
-typedef int            o_uid_t;
-typedef int            o_gid_t;
-typedef struct kauth_cred cred_t;
-typedef uintptr_t      pc_t;
-typedef struct vm_page page_t;
-typedef        ushort_t        o_mode_t;       /* old file attribute type */
-typedef        u_longlong_t    diskaddr_t;
-typedef void           *zone_t;
-typedef struct vfsops  vfsops_t;
-
-#ifdef _KERNEL
-
-typedef        short           index_t;
-typedef        off_t           offset_t;
-typedef        int64_t         rlim64_t;
-typedef __caddr_t      caddr_t;        /* core address */
-
-#else
-
-typedef        longlong_t      offset_t;
-typedef        u_longlong_t    u_offset_t;
-typedef        uint64_t        upad64_t;
-typedef        struct timespec timespec_t;
-typedef        int32_t         daddr32_t;
-typedef        int32_t         time32_t;
-
-#endif /* !_KERNEL */
-
-#define        MAXOFFSET_T     0x7fffffffffffffffLL
-#define        seg_rw          uio_rw
-#define        S_READ          UIO_READ
-#define        S_WRITE         UIO_WRITE
-struct aio_req;
-typedef void           *dev_info_t;
+#include <sys/opentypes.h>
 
 #endif /* !_OPENSOLARIS_SYS_TYPES_H_ */



Home | Main Index | Thread Index | Old Index