Permalink
Browse files

Compile with older glibc, thanks to Bringfried Stecklum

  • Loading branch information...
1 parent ee3249b commit 816f6d7a52266167a1e6fa3649b43523459ea626 @vasi committed May 17, 2011
Showing with 4 additions and 4 deletions.
  1. +1 −1 Makefile
  2. +3 −3 endian.c
View
@@ -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
View
@@ -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);
}

0 comments on commit 816f6d7

Please sign in to comment.