diff --git a/Makefile b/Makefile index 3dc5680..48db5c7 100644 --- a/Makefile +++ b/Makefile @@ -9,7 +9,7 @@ ifeq ($(CC),gcc) endif endif OPT = -g -O0 -CFLAGS = $(patsubst %,-I%/include,$(LIBPREFIX)) $(OPT) -std=c99 \ +CFLAGS = $(patsubst %,-I%/include,$(LIBPREFIX)) $(OPT) -std=gnu99 \ -Wall -Wno-unknown-pragmas LDFLAGS = $(patsubst %,-L%/lib,$(LIBPREFIX)) $(OPT) -Wall diff --git a/endian.c b/endian.c index 33c042b..a0f9fc6 100644 --- a/endian.c +++ b/endian.c @@ -15,14 +15,14 @@ void xle64enc(uint8_t *d, uint64_t n) { #define _BSD_SOURCE #include -#include +#include uint64_t xle64dec(const uint8_t *d) { - return le64toh(*(uint64_t*)d); + return __le64_to_cpu(*(uint64_t*)d); } void xle64enc(uint8_t *d, uint64_t n) { - *(uint64_t*)d = htole64(n); + *(uint64_t*)d = __cpu_to_le64(n); }