Source-Changes-HG archive

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

[src/trunk]: src/sys/external/bsd/libnv/dist FIx userland build



details:   https://anonhg.NetBSD.org/src/rev/ed3d938ea6a1
branches:  trunk
changeset: 433338:ed3d938ea6a1
user:      christos <christos%NetBSD.org@localhost>
date:      Sat Sep 08 14:12:53 2018 +0000

description:
FIx userland build

diffstat:

 sys/external/bsd/libnv/dist/dnvlist.c        |   6 +-
 sys/external/bsd/libnv/dist/nv_impl.h        |  66 ++++++++++++++--------------
 sys/external/bsd/libnv/dist/nv_kern_netbsd.c |   6 +-
 sys/external/bsd/libnv/dist/nvlist.c         |   6 +-
 4 files changed, 42 insertions(+), 42 deletions(-)

diffs (174 lines):

diff -r c0f9cd3b8d5e -r ed3d938ea6a1 sys/external/bsd/libnv/dist/dnvlist.c
--- a/sys/external/bsd/libnv/dist/dnvlist.c     Sat Sep 08 14:11:41 2018 +0000
+++ b/sys/external/bsd/libnv/dist/dnvlist.c     Sat Sep 08 14:12:53 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: dnvlist.c,v 1.2 2018/09/08 14:02:15 christos Exp $     */
+/*     $NetBSD: dnvlist.c,v 1.3 2018/09/08 14:12:53 christos Exp $     */
 
 /*-
  * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
@@ -35,7 +35,7 @@
 #ifdef __FreeBSD__
 __FBSDID("$FreeBSD: head/sys/contrib/libnv/dnvlist.c 328474 2018-01-27 12:58:21Z oshogbo $");
 #else
-__RCSID("$NetBSD: dnvlist.c,v 1.2 2018/09/08 14:02:15 christos Exp $");
+__RCSID("$NetBSD: dnvlist.c,v 1.3 2018/09/08 14:12:53 christos Exp $");
 #endif
 
 #if defined(_KERNEL) || defined(_STANDALONE)
@@ -57,7 +57,7 @@
 #include <stdlib.h>
 #endif
 
-#ifndef __FreeBSD__
+#ifdef __FreeBSD__
 #include <sys/dnv.h>
 #include <sys/nv.h>
 #else
diff -r c0f9cd3b8d5e -r ed3d938ea6a1 sys/external/bsd/libnv/dist/nv_impl.h
--- a/sys/external/bsd/libnv/dist/nv_impl.h     Sat Sep 08 14:11:41 2018 +0000
+++ b/sys/external/bsd/libnv/dist/nv_impl.h     Sat Sep 08 14:12:53 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nv_impl.h,v 1.2 2018/09/08 14:02:15 christos Exp $     */
+/*     $NetBSD: nv_impl.h,v 1.3 2018/09/08 14:12:53 christos Exp $     */
 
 /*-
  * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
@@ -56,58 +56,58 @@
 #define        NV_FLAG_IN_ARRAY                0x100
 
 #if defined(_KERNEL)
-#define        nv_malloc(size)                 malloc((size), M_NVLIST, M_WAITOK)
-#ifdef __FreeBSD__
-#define        nv_calloc(n, size)              mallocarray((n), (size), M_NVLIST, \
+# define nv_malloc(size)               malloc((size), M_NVLIST, M_WAITOK)
+# ifdef __FreeBSD__
+#  define nv_calloc(n, size)           mallocarray((n), (size), M_NVLIST, \
                                            M_WAITOK | M_ZERO)
-#else
+# else
 extern void *nv_calloc(size_t, size_t);
-#endif
-#define        nv_realloc(buf, size)           realloc((buf), (size), M_NVLIST, \
+# endif
+# define nv_realloc(buf, size)         realloc((buf), (size), M_NVLIST, \
                                            M_WAITOK)
-#define        nv_free(buf)                    free((buf), M_NVLIST)
-#ifdef __FreeBSD__
-#define        nv_strdup(buf)                  strdup((buf), M_NVLIST)
-#else
+# define nv_free(buf)                  free((buf), M_NVLIST)
+# ifdef __FreeBSD__
+#  define nv_strdup(buf)               strdup((buf), M_NVLIST)
+# else
 extern char *nv_strdup(const char *);
-#endif
-#define        nv_vasprintf(ptr, ...)          vasprintf(ptr, M_NVLIST, __VA_ARGS__)
-#endif
+# endif
+# define nv_vasprintf(ptr, ...)                vasprintf(ptr, M_NVLIST, __VA_ARGS__)
 #elif defined(_STANDALONE)
 extern void *nv_malloc(size_t);
 extern void *nv_calloc(size_t, size_t);
 extern void *nv_realloc(void *, size_t);
 extern void nv_free(void *);
 extern char *nv_strdup(const char *);
-#define        nv_vasprintf(ptr, ...)          vasprintf(ptr, M_NVLIST, __VA_ARGS__)
-#else
+# define nv_vasprintf(ptr, ...)                vasprintf(ptr, M_NVLIST, __VA_ARGS__)
+#else /* USERLAND */
 
-#define        nv_malloc(size)                 malloc((size))
-#define        nv_calloc(n, size)              calloc((n), (size))
-#define        nv_realloc(buf, size)           realloc((buf), (size))
-#define        nv_free(buf)                    free((buf))
-#define        nv_strdup(buf)                  strdup((buf))
-#define        nv_vasprintf(ptr, ...)          vasprintf(ptr, __VA_ARGS__)
+# define nv_malloc(size)               malloc((size))
+# define nv_calloc(n, size)            calloc(n, size)
+# define nv_realloc(buf, size)         realloc((buf), (size))
+# define nv_free(buf)                  free((buf))
+# define nv_strdup(buf)                        strdup(buf)
+# define nv_vasprintf(ptr, ...)                vasprintf(ptr, __VA_ARGS__)
 
-#define        ERRNO_SET(var)                  do { errno = (var); } while (0)
-#define        ERRNO_SAVE()                    do {                            \
+# define ERRNO_SET(var)                        do {                            \
+                                               errno = (var);          \
+                                       } while (/*CONSTCOND*/0)
+# define ERRNO_SAVE()                  do {                            \
                                                int _serrno;            \
-                                                                       \
                                                _serrno = errno
 
-#define        ERRNO_RESTORE()                         errno = _serrno;        \
-                                       } while (0)
+# define ERRNO_RESTORE()                       errno = _serrno;        \
+                                       } while (/*CONSTCOND*/0)
 
-#define        ERRNO_OR_DEFAULT(default)       (errno == 0 ? (default) : errno)
+# define ERRNO_OR_DEFAULT(default)     (errno == 0 ? (default) : errno)
 
 #endif
 
 #ifndef ERRNO_SET
-#define        ERRNO_SET(var)                  do { } while (/*CONSTCOND*/0)
-#define        ERRNO_SAVE()                    do { do { } while(/*CONSTCOND*/0)
-#define        ERRNO_RESTORE()                 } while (/*CONSTCOND*/0)
-
-#define        ERRNO_OR_DEFAULT(default)       (default)
+# define ERRNO_SET(var)                        do { } while (/*CONSTCOND*/0)
+# define ERRNO_SAVE()                  do { do { } while(/*CONSTCOND*/0)
+# define ERRNO_RESTORE()               } while (/*CONSTCOND*/0)
+ 
+# define ERRNO_OR_DEFAULT(default)     (default)
 #endif
 
 int    *nvlist_descriptors(const nvlist_t *nvl, size_t *nitemsp);
diff -r c0f9cd3b8d5e -r ed3d938ea6a1 sys/external/bsd/libnv/dist/nv_kern_netbsd.c
--- a/sys/external/bsd/libnv/dist/nv_kern_netbsd.c      Sat Sep 08 14:11:41 2018 +0000
+++ b/sys/external/bsd/libnv/dist/nv_kern_netbsd.c      Sat Sep 08 14:12:53 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nv_kern_netbsd.c,v 1.1 2018/09/08 14:02:15 christos Exp $      */
+/*     $NetBSD: nv_kern_netbsd.c,v 1.2 2018/09/08 14:12:53 christos Exp $      */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -29,8 +29,8 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include <sys/ctypes.h>
-__RCSID("$NetBSD: nv_kern_netbsd.c,v 1.1 2018/09/08 14:02:15 christos Exp $");
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: nv_kern_netbsd.c,v 1.2 2018/09/08 14:12:53 christos Exp $");
 
 #if !defined(_KERNEL) && !defined(_STANDALONE)
 #include <sys/mman.h>
diff -r c0f9cd3b8d5e -r ed3d938ea6a1 sys/external/bsd/libnv/dist/nvlist.c
--- a/sys/external/bsd/libnv/dist/nvlist.c      Sat Sep 08 14:11:41 2018 +0000
+++ b/sys/external/bsd/libnv/dist/nvlist.c      Sat Sep 08 14:12:53 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nvlist.c,v 1.2 2018/09/08 14:02:15 christos Exp $      */
+/*     $NetBSD: nvlist.c,v 1.3 2018/09/08 14:12:53 christos Exp $      */
 
 /*-
  * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
@@ -36,7 +36,7 @@
 #ifdef __FreeBSD__
 __FBSDID("$FreeBSD: head/sys/contrib/libnv/nvlist.c 335347 2018-06-18 22:57:32Z oshogbo $");
 #else
-__RCSID("$NetBSD: nvlist.c,v 1.2 2018/09/08 14:02:15 christos Exp $");
+__RCSID("$NetBSD: nvlist.c,v 1.3 2018/09/08 14:12:53 christos Exp $");
 #endif
 
 #include <sys/param.h>
@@ -77,7 +77,7 @@
 #ifdef __FreeBSD__
 #include <sys/nv.h>
 #else
-#incude "nv.h"
+#include "nv.h"
 #endif
 
 #include "nv_impl.h"



Home | Main Index | Thread Index | Old Index