fixed compilation on Mac OS X

This commit is contained in:
Frank Morgner
2015-04-13 09:04:42 +02:00
parent b4ebc4882b
commit 39d0a6f3ff
2 changed files with 5 additions and 1 deletions

View File

@@ -33,6 +33,10 @@
/* FIXME might not always work */
#define htole16(x) (x)
#define htole32(x) (x)
#elif __APPLE__
#include <libkern/OSByteOrder.h>
#define htole16(x) OSSwapHostToLittleInt16(x)
#define htole32(x) OSSwapHostToLittleInt32(x)
#else
#ifndef _BSD_SOURCE
#define _BSD_SOURCE /* See feature_test_macros(7) */