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

@@ -159,7 +159,7 @@ AC_TYPE_UINT8_T
# Checks for library functions.
AC_FUNC_MALLOC
AC_FUNC_REALLOC
AC_CHECK_FUNCS([getline memmove memset strerror gettimeofday strtol])
AC_CHECK_FUNCS([getline memmove memset strerror gettimeofday strtol strlcpy])
AC_SUBST(DYN_LIB_EXT)
case "$host" in

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) */