diff --git a/include/portable_endian.h b/include/portable_endian.h index f6b70f0..3f1d532 100644 --- a/include/portable_endian.h +++ b/include/portable_endian.h @@ -41,22 +41,29 @@ # define __LITTLE_ENDIAN LITTLE_ENDIAN # define __PDP_ENDIAN PDP_ENDIAN -#elif defined(__OpenBSD__) || defined(__FreeBSD__) - -# include - -#elif defined(__NetBSD__) || defined(__DragonFly__) +#elif defined(__OpenBSD__) || defined(__NetBSD__) || defined(__FreeBSD__) || defined(__DragonFly__) # include +/* For functions still missing, try to substitute 'historic' OpenBSD names */ +#ifndef be16toh # define be16toh(x) betoh16(x) +#endif +#ifndef le16toh # define le16toh(x) letoh16(x) - +#endif +#ifndef be32toh # define be32toh(x) betoh32(x) +#endif +#ifndef le32toh # define le32toh(x) letoh32(x) - +#endif +#ifndef be64toh # define be64toh(x) betoh64(x) +#endif +#ifndef le64toh # define le64toh(x) letoh64(x) +#endif #elif defined(__WINDOWS__)