From 816f6d7a52266167a1e6fa3649b43523459ea626 Mon Sep 17 00:00:00 2001 From: Dave Vasilevsky Date: Tue, 17 May 2011 15:04:15 -0400 Subject: [PATCH] Compile with older glibc, thanks to Bringfried Stecklum --- Makefile | 2 +- endian.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) 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); }