summaryrefslogtreecommitdiff
path: root/util/cbfstool
diff options
context:
space:
mode:
Diffstat (limited to 'util/cbfstool')
-rw-r--r--util/cbfstool/common.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/util/cbfstool/common.h b/util/cbfstool/common.h
index 7fa7c7e39b..06ee00b39b 100644
--- a/util/cbfstool/common.h
+++ b/util/cbfstool/common.h
@@ -28,9 +28,11 @@
/* Endianess */
#include "swab.h"
-#ifndef __APPLE__
+#if !defined(__APPLE__) && !defined(__NetBSD__)
#define ntohl(x) (is_big_endian() ? (uint32_t)(x) : swab32(x))
#define htonl(x) (is_big_endian() ? (uint32_t)(x) : swab32(x))
+#elif defined(__NetBSD__)
+#include <arpa/inet.h>
#endif
#define ntohll(x) (is_big_endian() ? (uint64_t)(x) : swab64(x))
#define htonll(x) (is_big_endian() ? (uint64_t)(x) : swab64(x))