commit - 23a9967121cd2e7ead33dc7ccdeac7d8be2855c8
commit + 4c1ef99ca3a41b189f7f1ce8366e84328835e152
blob - a994af5c7645accbb068605407520b0175a008ad
blob + ad1273c0a22318d0fc4e2061e5313da3d9857ee7
--- Makefile
+++ Makefile
amused.1 \
configure \
configure.local.example \
+ endian.h \
imsg.h \
queue.h \
tests.c \
blob - 478ac4b58ff524c05d96c620edcf889183dd58e7
blob + ab6762a5faffa05b3485da9b150499246a59840d
--- configure
+++ configure
#----------------------------------------------------------------------
HAVE_CAPSICUM=
+HAVE_ENDIAN_H=
HAVE_ERR=
HAVE_EXPLICIT_BZERO=
HAVE_FLOCK=
HAVE_STRNDUP=
HAVE_STRNLEN=
HAVE_STRTONUM=
+HAVE_SYS_ENDIAN_H=
HAVE_SYS_FILE=
HAVE_SYS_QUEUE=
HAVE_SYSTRACE=0
fi
runtest capsicum CAPSICUM || true
+runtest endian_h ENDIAN_H || true
runtest err ERR || true
runtest explicit_bzero EXPLICIT_BZERO || true
runtest flock FLOCK || true
runtest strnlen STRNLEN || true
runtest strtonum STRTONUM || true
runtest sys_queue SYS_QUEUE || true
+runtest sys_endian_h SYS_ENDIAN_H || true
runtest sys_file SYS_FILE || true
runtest timespecsub TIMESPECSUB || true
runtest unveil UNVEIL || true
* Results of configuration feature-testing.
*/
#define HAVE_CAPSICUM ${HAVE_CAPSICUM}
+#define HAVE_ENDIAN_H ${HAVE_ENDIAN_H}
#define HAVE_ERR ${HAVE_ERR}
#define HAVE_EXPLICIT_BZERO ${HAVE_EXPLICIT_BZERO}
#define HAVE_FLOCK ${HAVE_FLOCK}
#define HAVE_STRNDUP ${HAVE_STRNDUP}
#define HAVE_STRNLEN ${HAVE_STRNLEN}
#define HAVE_STRTONUM ${HAVE_STRTONUM}
+#define HAVE_SYS_ENDIAN_H ${HAVE_SYS_ENDIAN_H}
#define HAVE_SYS_FILE ${HAVE_SYS_FILE}
#define HAVE_SYS_QUEUE ${HAVE_SYS_QUEUE}
#define HAVE_SYSTRACE ${HAVE_SYSTRACE}
blob - /dev/null
blob + ca4997d23e9ca92fd81697865e695f81039f7af3 (mode 644)
--- /dev/null
+++ endian.h
+#include "../../config.h"
+
+#if HAVE_SYS_ENDIAN_H
+# include <sys/endian.h>
+#else
+# include <machine/endian.h>
+# include <libkern/OSByteOrder.h>
+
+# define htobe16(x) OSSwapHostToBigInt16(x)
+# define htole16(x) OSSwapHostToLittleInt16(x)
+# define be16toh(x) OSSwapBigToHostInt16(x)
+# define le16toh(x) OSSwapLittleToHostInt16(x)
+
+# define htobe32(x) OSSwapHostToBigInt32(x)
+# define htole32(x) OSSwapHostToLittleInt32(x)
+# define be32toh(x) OSSwapBigToHostInt32(x)
+# define le32toh(x) OSSwapLittleToHostInt32(x)
+
+# define htobe64(x) OSSwapHostToBigInt64(x)
+# define htole64(x) OSSwapHostToLittleInt64(x)
+# define be64toh(x) OSSwapBigToHostInt64(x)
+# define le64toh(x) OSSwapLittleToHostInt64(x)
+#endif