Compile with older glibc, thanks to Bringfried Stecklum

pull/2/head
Dave Vasilevsky 13 years ago
parent ee3249bd47
commit 816f6d7a52

@ -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

@ -15,14 +15,14 @@ void xle64enc(uint8_t *d, uint64_t n) {
#define _BSD_SOURCE
#include <stdint.h>
#include <endian.h>
#include <asm/byteorder.h>
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);
}

Loading…
Cancel
Save