summarylogtreecommitdiffstats
path: root/0001-fix-build-when-TR1-enabled.patch
blob: ab381a7091efc6143f59ffd9b3c08d1124d5b708 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
From 2220b6cab905a4e96e1508bc2f9bb2d6c844d1dc Mon Sep 17 00:00:00 2001
From: Jeffrey Clark <h0tw1r3@users.noreply.github.com>
Date: Sat, 21 May 2016 17:33:02 -0500
Subject: [PATCH 1/1] fix build when TR1 enabled

appears to be the default with g++ 6
---
 extlibs/gameswf/base/utility.h | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/extlibs/gameswf/base/utility.h b/extlibs/gameswf/base/utility.h
index 116cec7..28e7727 100644
--- a/extlibs/gameswf/base/utility.h
+++ b/extlibs/gameswf/base/utility.h
@@ -81,9 +81,11 @@ void	operator delete[](void* ptr);
 inline int64	i64abs(int64 i) { if (i < 0) return -i; else return i; }
 inline int	iabs(int i) { if (i < 0) return -i; else return i; }
 inline int	imax(int a, int b) { if (a < b) return b; else return a; }
-inline float	fmax(float a, float b) { if (a < b) return b; else return a; }
 inline int	imin(int a, int b) { if (a < b) return a; else return b; }
+#ifndef _GLIBCXX_USE_C99_MATH_TR1
 inline float	fmin(float a, float b) { if (a < b) return a; else return b; }
+inline float	fmax(float a, float b) { if (a < b) return b; else return a; }
+#endif
 
 
 inline int	iclamp(int i, int min, int max) {
@@ -99,7 +101,9 @@ inline float	fclamp(float f, float xmin, float xmax) {
 inline float flerp(float a, float b, float f) { return (b - a) * f + a; }
 
 const float LN_2 = 0.693147180559945f;
+#ifndef _GLIBCXX_USE_C99_MATH_TR1
 inline float	log2(float f) { return logf(f) / LN_2; }
+#endif
 
 inline int	fchop( float f ) { return (int) f; }	// replace w/ inline asm if desired
 inline int	frnd(float f) { return fchop(f + 0.5f); }	// replace with inline asm if desired
-- 
2.8.2