From 4ad1f9d3595da336f9f11fa77ee5b01c52b0656b Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Thu, 8 May 2014 16:34:31 +0000
Subject: undef PAGESIZE on HAIKU

* gcc2 build fix on pixma_parse.c

diff --git a/src/testpattern/testpattern.c b/src/testpattern/testpattern.c
index b31128f..4ffa520 100644
--- a/src/testpattern/testpattern.c
+++ b/src/testpattern/testpattern.c
@@ -38,6 +38,9 @@
 #include <stdio.h>
 #include <math.h>
 #include <string.h>
+#ifdef __HAIKU__
+#undef PAGESIZE
+#endif
 #include "testpattern.h"
 #include <gutenprint/gutenprint-intl.h>
 #include <errno.h>
diff --git a/src/testpattern/testpatternl.c b/src/testpattern/testpatternl.c
index cee5dea..5990d70 100644
--- a/src/testpattern/testpatternl.c
+++ b/src/testpattern/testpatternl.c
@@ -20,6 +20,9 @@
 #include <string.h>
 #include <errno.h>
 #include <stdlib.h>
+#ifdef __HAIKU__
+#undef PAGESIZE
+#endif
 
 /* end standard C headers. */
 
diff --git a/src/testpattern/testpatternl.l b/src/testpattern/testpatternl.l
index f4f6708..7364f63 100644
--- a/src/testpattern/testpatternl.l
+++ b/src/testpattern/testpatternl.l
@@ -29,6 +29,9 @@
 #include <string.h>
 #include <stdio.h>
 #include <stdlib.h>
+#ifdef __HAIKU__
+#undef PAGESIZE
+#endif
 #include "testpattern.h"
 
 #pragma GCC diagnostic ignored "-Wredundant-decls"
diff --git a/src/testpattern/testpatterny.c b/src/testpattern/testpatterny.c
index 818087e..ea0e141 100644
--- a/src/testpattern/testpatterny.c
+++ b/src/testpattern/testpatterny.c
@@ -78,6 +78,9 @@
 #include <string.h>
 #include <stdio.h>
 #include <stdlib.h>
+#ifdef __HAIKU__
+#undef PAGESIZE
+#endif
 #include "testpattern.h"
 
 extern int mylineno;
diff --git a/src/testpattern/testpatterny.y b/src/testpattern/testpatterny.y
index 229109a..6c6e8f8 100644
--- a/src/testpattern/testpatterny.y
+++ b/src/testpattern/testpatterny.y
@@ -29,6 +29,9 @@
 #include <string.h>
 #include <stdio.h>
 #include <stdlib.h>
+#ifdef __HAIKU__
+#undef PAGESIZE
+#endif
 #include "testpattern.h"
 
 extern int mylineno;
-- 
1.8.3.4


From 67f129ba6cdfe266fea43411661d7d6584b8ab4a Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Wed, 17 Sep 2014 17:49:21 +0000
Subject: strings.h fixes


diff --git a/src/main/curve.c b/src/main/curve.c
index 7e4d02b..9d9ccec 100644
--- a/src/main/curve.c
+++ b/src/main/curve.c
@@ -32,6 +32,7 @@
 #include <ieeefp.h>
 #endif
 #include <string.h>
+#include <strings.h>
 #include <stdlib.h>
 #include <limits.h>
 #include <unistd.h>
diff --git a/src/main/escp2-papers.c b/src/main/escp2-papers.c
index f1c44b4..cfd3466 100644
--- a/src/main/escp2-papers.c
+++ b/src/main/escp2-papers.c
@@ -24,6 +24,7 @@
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
+#include <strings.h>
 #include <gutenprint/gutenprint.h>
 #include "gutenprint-internal.h"
 #include <gutenprint/gutenprint-intl-internal.h>
diff --git a/src/main/print-ps.c b/src/main/print-ps.c
index d969596..d59fd6a 100644
--- a/src/main/print-ps.c
+++ b/src/main/print-ps.c
@@ -34,6 +34,7 @@
 #include "gutenprint-internal.h"
 #include <time.h>
 #include <string.h>
+#include <strings.h>
 #include <math.h>
 #ifdef HAVE_LIMITS_H
 #include <limits.h>
diff --git a/src/main/xmlppd.c b/src/main/xmlppd.c
index 0ee9dc9..27bd6b8 100644
--- a/src/main/xmlppd.c
+++ b/src/main/xmlppd.c
@@ -26,6 +26,7 @@
 #include <gutenprint/util.h>
 #include <gutenprint/string-list.h>
 #include <stdlib.h>
+#include <strings.h>
 #include "xmlppd.h"
 
 typedef struct
-- 
1.8.3.4


From 87664680829de821756bfe70a07f308e7a2c8d89 Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Wed, 17 Sep 2014 18:37:22 +0000
Subject: fixes endianess check


diff --git a/src/main/print-olympus.c b/src/main/print-olympus.c
index 42c4897..0687f74 100644
--- a/src/main/print-olympus.c
+++ b/src/main/print-olympus.c
@@ -4901,13 +4901,13 @@ dyesub_do_print(stp_vars_t *v, stp_image_t *image)
   }
 
   if (pv.bytes_per_ink_channel > 1) {
-#if defined(__LITTLE_ENDIAN) || defined(__LITTLE_ENDIAN__)
+#if __BYTE_ORDER == __LITTLE_ENDIAN
     pv.byteswap = dyesub_feature(caps, DYESUB_FEATURE_BIGENDIAN);
-#elif defined (__BIG_ENDIAN) || defined(__BIG_ENDIAN__)
+#elif __BYTE_ORDER == __BIG_ENDIAN
     pv.byteswap = !dyesub_feature(caps, DYESUB_FEATURE_BIGENDIAN);
 #else
 #error "Unable to determine endianness, aborting compilation!"
-#endif    
+#endif
   }
 
   pv.image_data = dyesub_read_image(v, &pv, image);
-- 
1.8.3.4


From a7d48485dc30cc480b2ad1203ac36d0d13ec7c34 Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Wed, 17 Sep 2014 18:55:46 +0000
Subject: strings.h fixes


diff --git a/src/escputil/escputil.c b/src/escputil/escputil.c
index d7fec55..e0157e8 100644
--- a/src/escputil/escputil.c
+++ b/src/escputil/escputil.c
@@ -27,6 +27,7 @@
 #include <stdio.h>
 #include <unistd.h>
 #include <string.h>
+#include <strings.h>
 #include <stdlib.h>
 #include <errno.h>
 #include <signal.h>
diff --git a/src/testpattern/testpatternl.c b/src/testpattern/testpatternl.c
index 5990d70..819eee0 100644
--- a/src/testpattern/testpatternl.c
+++ b/src/testpattern/testpatternl.c
@@ -18,6 +18,7 @@
 /* begin standard C headers. */
 #include <stdio.h>
 #include <string.h>
+#include <strings.h>
 #include <errno.h>
 #include <stdlib.h>
 #ifdef __HAIKU__
diff --git a/src/testpattern/testpatternl.l b/src/testpattern/testpatternl.l
index 7364f63..90f635f 100644
--- a/src/testpattern/testpatternl.l
+++ b/src/testpattern/testpatternl.l
@@ -27,6 +27,7 @@
 #endif
 
 #include <string.h>
+#include <strings.h>
 #include <stdio.h>
 #include <stdlib.h>
 #ifdef __HAIKU__
diff --git a/src/testpattern/testpatterny.c b/src/testpattern/testpatterny.c
index ea0e141..12651b7 100644
--- a/src/testpattern/testpatterny.c
+++ b/src/testpattern/testpatterny.c
@@ -76,6 +76,7 @@
 #endif
 
 #include <string.h>
+#include <strings.h>
 #include <stdio.h>
 #include <stdlib.h>
 #ifdef __HAIKU__
diff --git a/src/testpattern/testpatterny.y b/src/testpattern/testpatterny.y
index 6c6e8f8..b495143 100644
--- a/src/testpattern/testpatterny.y
+++ b/src/testpattern/testpatterny.y
@@ -27,6 +27,7 @@
 #endif
 
 #include <string.h>
+#include <strings.h>
 #include <stdio.h>
 #include <stdlib.h>
 #ifdef __HAIKU__
-- 
1.8.3.4

