From 9c137ea48247801d309d867244820833685e2477 Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Thu, 15 May 2014 16:14:06 +0000
Subject: undef _PACKED (defined in Bebuild.h)


diff --git a/lz4.c b/lz4.c
index fd229ef..9284bbf 100644
--- a/lz4.c
+++ b/lz4.c
@@ -188,6 +188,7 @@
   typedef unsigned long long  U64;
 #endif
 
+#undef _PACKED
 #if defined(__GNUC__)  && !defined(LZ4_FORCE_UNALIGNED_ACCESS)
 #  define _PACKED __attribute__ ((packed))
 #else
diff --git a/lz4hc.c b/lz4hc.c
index e84de2b..cb72ef8 100644
--- a/lz4hc.c
+++ b/lz4hc.c
@@ -158,6 +158,7 @@
   typedef unsigned long long  U64;
 #endif
 
+#undef _PACKED
 #if defined(__GNUC__)  && !defined(LZ4_FORCE_UNALIGNED_ACCESS)
 #  define _PACKED __attribute__ ((packed))
 #else
diff --git a/programs/xxhash.c b/programs/xxhash.c
index 8304ec2..d4aa50e 100644
--- a/programs/xxhash.c
+++ b/programs/xxhash.c
@@ -110,6 +110,7 @@ FORCE_INLINE void* XXH_memcpy(void* dest, const void* src, size_t size) { return
   typedef unsigned long long U64;
 #endif
 
+#undef _PACKED
 #if defined(__GNUC__)  && !defined(XXH_USE_UNALIGNED_ACCESS)
 #  define _PACKED __attribute__ ((packed))
 #else
-- 
1.8.3.4


From 83f35b4005aa62773f52a843d3f515854baaf787 Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Thu, 15 May 2014 16:18:40 +0000
Subject: PAGE_SIZE is already defined on Haiku


diff --git a/programs/fuzzer.c b/programs/fuzzer.c
index ba4f960..fa84aec 100644
--- a/programs/fuzzer.c
+++ b/programs/fuzzer.c
@@ -53,6 +53,7 @@
 #define SEQ_MSK ((NUM_SEQ) - 1)
 #define MOD_SEQ(x) ((((x) >> 8) & 255) == 0)
 #define NEW_SEQ(x) ((((x) >> 10) %10) == 0)
+#undef PAGE_SIZE
 #define PAGE_SIZE 4096
 #define ROUND_PAGE(x) (((x) + PAGE_SIZE - 1) & ~(PAGE_SIZE - 1))
 #define PRIME1   2654435761U
-- 
1.8.3.4


From fbc8cf911a39fa5d64db09f5a3cf3d54f8614a24 Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Thu, 15 May 2014 16:20:36 +0000
Subject: Haiku install support


diff --git a/Makefile b/Makefile
index e5797c7..c976c95 100644
--- a/Makefile
+++ b/Makefile
@@ -106,7 +106,7 @@ clean:
 
 
 #make install option is reserved to Linux & OSX targets
-ifneq (,$(filter $(shell uname),Linux Darwin))
+ifneq (,$(filter $(shell uname),Linux Darwin Haiku))
 
 install: liblz4
 	@install -d -m 755 $(DESTDIR)$(LIBDIR)/ $(DESTDIR)$(INCLUDEDIR)/
diff --git a/programs/Makefile b/programs/Makefile
index 8ec0b85..aa5926b 100644
--- a/programs/Makefile
+++ b/programs/Makefile
@@ -37,8 +37,8 @@ CC:=$(CC)
 CFLAGS+= -std=c99 -O3 -Wall -W -Wundef -DLZ4_VERSION=\"$(RELEASE)\"
 FLAGS= -I.. $(CFLAGS)
 
-BINDIR=$(PREFIX)/bin
-MANDIR=$(PREFIX)/share/man/man1
+#BINDIR=$(PREFIX)/bin
+#MANDIR=$(PREFIX)/share/man/man1
 LZ4DIR=..
 
 TEST_FILES = COPYING
@@ -83,7 +83,7 @@ clean:
 	@echo Cleaning completed
 
 
-ifneq (,$(filter $(shell uname),Linux Darwin))
+ifneq (,$(filter $(shell uname),Linux Darwin, Haiku))
 
 install: lz4 lz4c
 	@echo Installing binaries
-- 
1.8.3.4


From 52f22e57e55cc5f4dbaab5dc9acae3491916b306 Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Fri, 16 May 2014 14:16:07 +0000
Subject: gcc2 doesn't know std=c99


diff --git a/Makefile b/Makefile
index c976c95..4964a59 100644
--- a/Makefile
+++ b/Makefile
@@ -39,7 +39,7 @@ LIBVER=$(LIBVER_MAJOR).$(LIBVER_MINOR).$(LIBVER_PATCH)
 DESTDIR=
 PREFIX=/usr
 CC:=$(CC)
-CFLAGS+= -I. -std=c99 -O3 -Wall -W -Wundef -DLZ4_VERSION=\"$(RELEASE)\"
+CFLAGS+= -I. -O3 -Wall -W -Wundef -DLZ4_VERSION=\"$(RELEASE)\"
 
 LIBDIR=$(PREFIX)/lib
 INCLUDEDIR=$(PREFIX)/include
diff --git a/programs/Makefile b/programs/Makefile
index aa5926b..e380c35 100644
--- a/programs/Makefile
+++ b/programs/Makefile
@@ -34,7 +34,7 @@ RELEASE=r116
 DESTDIR=
 PREFIX=/usr
 CC:=$(CC)
-CFLAGS+= -std=c99 -O3 -Wall -W -Wundef -DLZ4_VERSION=\"$(RELEASE)\"
+CFLAGS+= -O3 -Wall -W -Wundef -DLZ4_VERSION=\"$(RELEASE)\"
 FLAGS= -I.. $(CFLAGS)
 
 #BINDIR=$(PREFIX)/bin
-- 
1.8.3.4


From bf73e35f83ed099523193493e77dd3b342937d89 Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Fri, 16 May 2014 14:20:25 +0000
Subject: we don't want 32-bit versions


diff --git a/programs/Makefile b/programs/Makefile
index e380c35..b89410f 100644
--- a/programs/Makefile
+++ b/programs/Makefile
@@ -53,7 +53,7 @@ endif
 
 default: lz4 lz4c
 
-all: lz4 lz4c lz4c32 fuzzer fuzzer32 fullbench fullbench32
+all: lz4 lz4c fuzzer fullbench
 
 lz4: $(LZ4DIR)/lz4.c $(LZ4DIR)/lz4hc.c bench.c xxhash.c lz4io.c lz4cli.c
 	$(CC)      $(FLAGS) -DDISABLE_LZ4C_LEGACY_OPTIONS $^ -o $@$(EXT)
-- 
1.8.3.4

