From d1f6ea785a4151b2cf3300d74584007489d8d6f6 Mon Sep 17 00:00:00 2001 From: Ykkrosh Date: Tue, 5 Jan 2010 20:55:07 +0000 Subject: [PATCH] Linux build fixes This was SVN commit r7247. --- source/lib/posix/posix.h | 1 + source/lib/posix/tests/test_posix.h | 16 ++++++++-------- source/lib/sysdep/filesystem.h | 2 ++ source/lib/sysdep/os/unix/ufilesystem.cpp | 2 -- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/source/lib/posix/posix.h b/source/lib/posix/posix.h index 58b27bcdef..160ac22bfe 100644 --- a/source/lib/posix/posix.h +++ b/source/lib/posix/posix.h @@ -150,6 +150,7 @@ extern size_t fpclassifyd(double d); // #ifndef and define it if it's not there already. // We've included above to make sure it defines that macro. # ifndef isfinite +# define fpclassify std::fpclassify # define isfinite std::isfinite # define isnan std::isnan # define isinf std::isinf diff --git a/source/lib/posix/tests/test_posix.h b/source/lib/posix/tests/test_posix.h index 0e79eaf456..d4e156ceef 100644 --- a/source/lib/posix/tests/test_posix.h +++ b/source/lib/posix/tests/test_posix.h @@ -34,14 +34,14 @@ public: T sub = std::numeric_limits::denorm_min(); T sub2 = std::numeric_limits::min() / 2; - TS_ASSERT_EQUALS(fpclassify(zero), FP_ZERO); - TS_ASSERT_EQUALS(fpclassify(one), FP_NORMAL); - TS_ASSERT_EQUALS(fpclassify(inf), FP_INFINITE); - TS_ASSERT_EQUALS(fpclassify(qnan), FP_NAN); - TS_ASSERT_EQUALS(fpclassify(snan), FP_NAN); - TS_ASSERT_EQUALS(fpclassify(min), FP_NORMAL); - TS_ASSERT_EQUALS(fpclassify(sub), FP_SUBNORMAL); - TS_ASSERT_EQUALS(fpclassify(sub2), FP_SUBNORMAL); + TS_ASSERT_EQUALS((int)fpclassify(zero), (int)FP_ZERO); + TS_ASSERT_EQUALS((int)fpclassify(one), (int)FP_NORMAL); + TS_ASSERT_EQUALS((int)fpclassify(inf), (int)FP_INFINITE); + TS_ASSERT_EQUALS((int)fpclassify(qnan), (int)FP_NAN); + TS_ASSERT_EQUALS((int)fpclassify(snan), (int)FP_NAN); + TS_ASSERT_EQUALS((int)fpclassify(min), (int)FP_NORMAL); + TS_ASSERT_EQUALS((int)fpclassify(sub), (int)FP_SUBNORMAL); + TS_ASSERT_EQUALS((int)fpclassify(sub2), (int)FP_SUBNORMAL); TS_ASSERT(!isnan(zero)); TS_ASSERT(!isnan(one)); diff --git a/source/lib/sysdep/filesystem.h b/source/lib/sysdep/filesystem.h index 63c872eaef..e12c191dae 100644 --- a/source/lib/sysdep/filesystem.h +++ b/source/lib/sysdep/filesystem.h @@ -65,7 +65,9 @@ extern int wclosedir(WDIR*); #define O_NO_AIO_NP 0x20000 // POSIX flags not supported by the underlying Win32 _wsopen_s: +#if OS_WIN #define O_NONBLOCK 0x1000000 +#endif extern int wopen(const wchar_t* pathname, int oflag, ...); extern int wclose(int fd); diff --git a/source/lib/sysdep/os/unix/ufilesystem.cpp b/source/lib/sysdep/os/unix/ufilesystem.cpp index 094daf8f46..c3de5a01ec 100644 --- a/source/lib/sysdep/os/unix/ufilesystem.cpp +++ b/source/lib/sysdep/os/unix/ufilesystem.cpp @@ -25,8 +25,6 @@ #include "lib/wchar.h" #include "lib/path_util.h" -struct DIR; - struct WDIR { DIR* d;