Skip to content

Commit

Permalink
Another try to detect BSD properly
Browse files Browse the repository at this point in the history
  • Loading branch information
GreyCat committed Jun 3, 2024
1 parent bc993b8 commit 0e8f60d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion kaitai/kaitaistream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@
#define __BYTE_ORDER BYTE_ORDER
#define __BIG_ENDIAN BIG_ENDIAN
#define __LITTLE_ENDIAN LITTLE_ENDIAN
#elif defined(BSD)
#else
// At this point it's either Linux or BSD. Both have "sys/param.h", so it's safe to include
#include <sys/param.h>
#if defined(BSD)
// Supposed to work on FreeBSD: https://man.freebsd.org/cgi/man.cgi?query=bswap16&manpath=FreeBSD+14.0-RELEASE
// Supposed to work on NetBSD: https://man.netbsd.org/NetBSD-10.0/bswap16.3
#include <sys/endian.h>
Expand All @@ -39,6 +42,7 @@
#include <endian.h>
#include <byteswap.h>
#endif
#endif

#include <iostream>
#include <vector>
Expand Down

0 comments on commit 0e8f60d

Please sign in to comment.