From 2b493536b50604fc0dda47518ee2997f1c5613f4 Mon Sep 17 00:00:00 2001
From: Adrien Destugues <pulkomandy@gmail.com>
Date: Mon, 8 Jun 2015 05:18:18 +0200
Subject: Haiku fixes.


diff --git a/src/Makefile.in b/src/Makefile.in
index d8b5de4..0018fcd 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -11,7 +11,7 @@ DEBUGFLAGS = {DEBUGFLAGS}
 COMMONGCCOPTS = -Wall -Wno-unused -Wno-format -Wmissing-prototypes -Wstrict-prototypes -fno-exceptions -O2
 
 TARGETCFLAGS = -fomit-frame-pointer $(COMMONGCCOPTS) $(DEBUGFLAGS) $(ARCHFLAGS)
-LIBRARIES = -lm $(AUDIOLIBS) $(ARCHLIBS)
+LIBRARIES = $(AUDIOLIBS) $(ARCHLIBS)
 
 # Native flags are used to build tools that generate new code that is then
 # compiled with the target compiler.
diff --git a/src/frontends/common/support.h b/src/frontends/common/support.h
index 1b32fe9..3445b79 100644
--- a/src/frontends/common/support.h
+++ b/src/frontends/common/support.h
@@ -7,8 +7,13 @@
 
 #define uadeerror(fmt, args...) do { fprintf(stderr, "uade: " fmt, ## args); exit(1); } while (0)
 
+#ifndef MAX
 #define MAX(x, y) ((x) >= (y) ? (x) : (y))
+#endif
+
+#ifndef MIN
 #define MIN(x, y) ((x) < (y) ? (x) : (y))
+#endif
 
 
 char *xbasename(const char *path);
diff --git a/src/frontends/uade123/Makefile.in b/src/frontends/uade123/Makefile.in
index e897d3c..818a4da 100644
--- a/src/frontends/uade123/Makefile.in
+++ b/src/frontends/uade123/Makefile.in
@@ -3,7 +3,7 @@ UADE123NAME = {UADE123NAME}
 
 CC = {CC}
 CFLAGS = -Wall -O2 -I../../include -I../common {AOFLAGS} {DEBUGFLAGS} {ARCHFLAGS}
-CLIBS = {AOLIBS} {ARCHLIBS} -lm
+CLIBS = {AOLIBS} {ARCHLIBS}
 
 all:	uade123
 
-- 
2.2.2


From 25e43f6a5768f46ac655af6fee3ece0351376a1a Mon Sep 17 00:00:00 2001
From: Adrien Destugues <pulkomandy@gmail.com>
Date: Mon, 8 Jun 2015 05:18:30 +0200
Subject: gcc2 workarounds


diff --git a/src/frontends/common/eagleplayer.c b/src/frontends/common/eagleplayer.c
index 7c8dfce..5fb6074 100644
--- a/src/frontends/common/eagleplayer.c
+++ b/src/frontends/common/eagleplayer.c
@@ -36,7 +36,7 @@
 
 #define MAX_SUFFIX_LENGTH 16
 
-#define eperror(fmt, args...) do { uadeerror("Eagleplayer.conf error on line %zd: " fmt, lineno, ## args); } while (0)
+#define eperror(fmt, args...) do { uadeerror("Eagleplayer.conf error: " fmt, ## args); } while (0)
 
 
 /* Table for associating eagleplayer.conf, song.conf and uade.conf options
diff --git a/src/frontends/common/songdb.c b/src/frontends/common/songdb.c
index b7d7916..b0ed193 100644
--- a/src/frontends/common/songdb.c
+++ b/src/frontends/common/songdb.c
@@ -22,7 +22,7 @@
 #define NORM_ID "n="
 #define NORM_ID_LENGTH 2
 
-#define eserror(fmt, args...) do { fprintf(stderr, "song.conf error on line %zd: " fmt "\n", lineno, ## args); exit(-1); } while (0)
+#define eserror(fmt, args...) do { fprintf(stderr, "song.conf error: " fmt "\n", ## args); exit(-1); } while (0)
 
 
 struct eaglesong {
diff --git a/src/include/uadeutils.h b/src/include/uadeutils.h
index fcd2423..3806bc7 100644
--- a/src/include/uadeutils.h
+++ b/src/include/uadeutils.h
@@ -4,7 +4,7 @@
 #include <stdint.h>
 
 #define uade_error(fmt, args...) do { \
-    fprintf(stderr, "%s:%d: %s: " fmt, __FILE__, __LINE__, __func__, ## args); \
+    fprintf(stderr, fmt, ## args); \
     abort(); \
   } while (0)
 
diff --git a/src/include/unixsupport.h b/src/include/unixsupport.h
index dc7d545..1d4ae1d 100644
--- a/src/include/unixsupport.h
+++ b/src/include/unixsupport.h
@@ -12,7 +12,7 @@
 
 #define die(fmt, args...) do { fprintf(stderr, "uade: " fmt, ## args); exit(1); } while(0)
 
-#define dieerror(fmt, args...) do { fprintf(stderr, "uade: " fmt ": %s\n", ## args, strerror(errno)); exit(1); } while(0)
+#define dieerror(fmt, args...) do { fprintf(stderr, "uade: " fmt , ## args); exit(1); } while(0)
 
 
 char *uade_dirname(char *dst, char *src, size_t maxlen);
-- 
2.2.2

