mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-29 11:38:52 +02:00
73 lines
1.8 KiB
Plaintext
73 lines
1.8 KiB
Plaintext
From b13bf235eca59415b516a788a93fd5458e191a03 Mon Sep 17 00:00:00 2001
|
|
From: Gerasim Troeglazov <3dEyes@gmail.com>
|
|
Date: Tue, 16 Jun 2020 23:43:49 +1000
|
|
Subject: Use min/max
|
|
|
|
|
|
diff --git a/src/compiler.h b/src/compiler.h
|
|
index 82efd7a..61e6f39 100644
|
|
--- a/src/compiler.h
|
|
+++ b/src/compiler.h
|
|
@@ -28,7 +28,6 @@
|
|
$Id$
|
|
*/
|
|
|
|
-#ifndef __HAIKU__
|
|
#ifdef __GNUC__
|
|
// This version has strict type checking for safety.
|
|
// See the "unnecessary" pointer comparison. (from Linux)
|
|
@@ -46,7 +45,6 @@
|
|
#define min(a,b) (((a) < (b)) ? (a) : (b))
|
|
#define max(a,b) (((a) > (b)) ? (a) : (b))
|
|
#endif
|
|
-#endif /* Not Haiku */
|
|
|
|
#define clamp(lo,value,hi) (min(max(value,lo),hi))
|
|
|
|
diff --git a/src/tp_magic_api.h.in b/src/tp_magic_api.h.in
|
|
index 442f13a..0366b8b 100644
|
|
--- a/src/tp_magic_api.h.in
|
|
+++ b/src/tp_magic_api.h.in
|
|
@@ -10,7 +10,6 @@
|
|
|
|
/* min() and max() variable comparisons: */
|
|
|
|
-#ifndef __HAIKU__
|
|
#ifdef __GNUC__
|
|
// This version has strict type checking for safety.
|
|
// See the "unnecessary" pointer comparison. (from Linux)
|
|
@@ -28,7 +27,6 @@
|
|
#define min(a,b) (((a) < (b)) ? (a) : (b))
|
|
#define max(a,b) (((a) > (b)) ? (a) : (b))
|
|
#endif
|
|
-#endif /* Not Haiku */
|
|
|
|
/* clamp() returns 'value', unless it's less than 'lo' or greater than 'hi',
|
|
in which cases it returns 'lo' or 'hi', respectively: */
|
|
--
|
|
2.26.0
|
|
|
|
|
|
From ad677235a7e423b8a080386a79fb880bbdced3c3 Mon Sep 17 00:00:00 2001
|
|
From: Gerasim Troeglazov <3dEyes@gmail.com>
|
|
Date: Wed, 17 Jun 2020 10:40:53 +1000
|
|
Subject: Use safer_dirent for Haiku
|
|
|
|
|
|
diff --git a/src/tuxpaint.c b/src/tuxpaint.c
|
|
index 60b1495..0632bcc 100644
|
|
--- a/src/tuxpaint.c
|
|
+++ b/src/tuxpaint.c
|
|
@@ -278,7 +278,7 @@ char *strcasestr(const char *haystack, const char *needle)
|
|
#include <dirent.h>
|
|
#include <signal.h>
|
|
|
|
-#if defined __BEOS__
|
|
+#if defined __BEOS__ || defined __HAIKU__
|
|
|
|
/* BeOS */
|
|
|
|
--
|
|
2.26.0
|
|
|