summaryrefslogtreecommitdiffstats
path: root/usr.bin/ctfconv/parse.c
diff options
context:
space:
mode:
authormpi <mpi@openbsd.org>2017-10-28 09:34:17 +0000
committermpi <mpi@openbsd.org>2017-10-28 09:34:17 +0000
commita9ec4c35b0628e995c2550059f2fe8ad303c1f0c (patch)
tree61a7854d5d6742933cc5fbc394e3a1984d074b84 /usr.bin/ctfconv/parse.c
parentCorrectly handle binaries without string table. (diff)
downloadwireguard-openbsd-a9ec4c35b0628e995c2550059f2fe8ad303c1f0c.tar.xz
wireguard-openbsd-a9ec4c35b0628e995c2550059f2fe8ad303c1f0c.zip
Define nitems() locally and stop including <sys/param.h>
Diffstat (limited to 'usr.bin/ctfconv/parse.c')
-rw-r--r--usr.bin/ctfconv/parse.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/usr.bin/ctfconv/parse.c b/usr.bin/ctfconv/parse.c
index ee49031f26c..af268362e2e 100644
--- a/usr.bin/ctfconv/parse.c
+++ b/usr.bin/ctfconv/parse.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.c,v 1.7 2017/09/24 09:14:25 jsg Exp $ */
+/* $OpenBSD: parse.c,v 1.8 2017/10/28 09:34:17 mpi Exp $ */
/*
* Copyright (c) 2016-2017 Martin Pieuchot
@@ -21,9 +21,9 @@
* DWARF to IT (internal type) representation parser.
*/
-#include <sys/param.h> /* nitems() */
#include <sys/queue.h>
#include <sys/tree.h>
+#include <sys/types.h>
#include <sys/ctf.h>
#include <assert.h>
@@ -46,6 +46,10 @@
struct pool it_pool, im_pool, ir_pool;
#endif /* NOPOOL */
+#ifndef nitems
+#define nitems(_a) (sizeof((_a)) / sizeof((_a)[0]))
+#endif
+
#define DPRINTF(x...) do { /*printf(x)*/ } while (0)
#define VOID_OFFSET 1 /* Fake offset for generating "void" type. */