Commit 9a595d5 1 parent 7efedd6 commit 9a595d5 Copy full SHA for 9a595d5
File tree 1 file changed +10
-0
lines changed
1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change 88
88
#include <sys/endian.h>
89
89
#endif
90
90
91
+ #if defined(__NetBSD__ )
92
+ /* Bring bswap{16,32,64} into scope: */
93
+ #include <sys/types.h>
94
+ #include <machine/bswap.h>
95
+ #endif
96
+
91
97
#if !defined(LITTLE_ENDIAN )
92
98
# if defined(__ORDER_LITTLE_ENDIAN__ )
93
99
# define LITTLE_ENDIAN __ORDER_LITTLE_ENDIAN__
122
128
# endif
123
129
#endif
124
130
131
+ #if !defined(__NetBSD__ )
132
+
125
133
#if !HAVE_DECL_BSWAP16
126
134
static really_inline uint16_t bswap16 (uint16_t x )
127
135
{
@@ -162,6 +170,8 @@ static really_inline uint64_t bswap64(uint64_t x)
162
170
}
163
171
#endif
164
172
173
+ #endif /* !defined(__NetBSD__) */
174
+
165
175
# if BYTE_ORDER == LITTLE_ENDIAN
166
176
# define htobe (bits , x ) bswap ## bits((x))
167
177
# define htole (bits , x ) (x)
You can’t perform that action at this time.
0 commit comments