diff --git a/configure.ac b/configure.ac index 1255db9..f77f7ca 100644 --- a/configure.ac +++ b/configure.ac @@ -26,6 +26,8 @@ AC_TYPE_SIZE_T # Checks for library functions. AC_FUNC_MALLOC AC_FUNC_REALLOC + +AC_CHECK_HEADERS([sys/types.h]) AC_CHECK_FUNCS([memset letoh32 htole32]) AC_CHECK_HEADERS([endian.h sys/endian.h]) @@ -36,6 +38,7 @@ fi AC_CHECK_HEADERS([byteswap.h]) AC_DEFINE([_XOPEN_SOURCE], [600], [Define to 500 if Single Unix conformance is wanted, 600 for sixth revision.]) +AC_DEFINE([_BSD_SOURCE], [1], [Define on BSD to activate all library features]) CFLAGS="$CFLAGS -std=c99" diff --git a/libfreefare/mifare_classic.c b/libfreefare/mifare_classic.c index 47de8f0..892fdfd 100644 --- a/libfreefare/mifare_classic.c +++ b/libfreefare/mifare_classic.c @@ -31,12 +31,15 @@ #include "config.h" +#if defined(HAVE_SYS_TYPES_H) +# include +#endif + #if defined(HAVE_SYS_ENDIAN_H) # include #endif #if defined(HAVE_ENDIAN_H) -# define _BSD_SOURCE # include #endif #include