summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2017-05-26 23:14:30 (GMT)
committer Slávek Banko <slavek.banko@axis.cz>2017-05-26 23:14:30 (GMT)
commite199b0f7781e38b97eb6bb5d5bfa147f520da77c (patch)
treee60046470ef269cbd03144c8f6ecd24cacbaed2b
parentf0c3db47bb2b37a13703385bf26bc4428278e218 (diff)
downloadtdegraphics-e199b0f7.zip
tdegraphics-e199b0f7.tar.gz
Fix FTBFS on fmin redefinitionHEADorigin/masterorigin/HEADmaster
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
-rw-r--r--config.h.cmake1
-rw-r--r--kviewshell/plugins/djvu/libdjvu/ConfigureChecks.cmake12
-rw-r--r--kviewshell/plugins/djvu/libdjvu/DjVuPalette.cpp3
3 files changed, 15 insertions, 1 deletions
diff --git a/config.h.cmake b/config.h.cmake
index e6d1fd2..3e51ef6 100644
--- a/config.h.cmake
+++ b/config.h.cmake
@@ -39,6 +39,7 @@
#define HAS_MBSTATE 1
#endif
#endif
+#cmakedefine HAVE_FMIN 1
// kmrml
#cmakedefine HAVE_STDLIB_H 1
diff --git a/kviewshell/plugins/djvu/libdjvu/ConfigureChecks.cmake b/kviewshell/plugins/djvu/libdjvu/ConfigureChecks.cmake
index 50f708f..aa63d2f 100644
--- a/kviewshell/plugins/djvu/libdjvu/ConfigureChecks.cmake
+++ b/kviewshell/plugins/djvu/libdjvu/ConfigureChecks.cmake
@@ -10,6 +10,7 @@
#################################################
include( CheckFunctionExists )
+include( CheckCXXSourceCompiles )
check_type_size( wchar_t WCHAR_T )
@@ -23,3 +24,14 @@ if( HAVE_WCHAR_T )
check_function_exists( wcrtomb HAVE_WCRTOMB )
endif( )
endif( )
+
+check_cxx_source_compiles(
+ "
+ #include <cmath>
+ int main(int, char*[]) {
+ float res = fmin(0, 1);
+ return 0;
+ }
+ "
+ HAVE_FMIN
+)
diff --git a/kviewshell/plugins/djvu/libdjvu/DjVuPalette.cpp b/kviewshell/plugins/djvu/libdjvu/DjVuPalette.cpp
index 9817515..0b8fa61 100644
--- a/kviewshell/plugins/djvu/libdjvu/DjVuPalette.cpp
+++ b/kviewshell/plugins/djvu/libdjvu/DjVuPalette.cpp
@@ -97,10 +97,11 @@ inline unsigned char
umin(unsigned char a, unsigned char b)
{ return (a>b) ? b : a; }
+#if !defined(HAVE_FMIN)
inline float
fmin(float a, float b)
{ return (a>b) ? b : a; }
-
+#endif
// ------- DJVUPALETTE