From 39a4781a5fba29f51f8c0354ea041528767e183a Mon Sep 17 00:00:00 2001 From: Glenn Rice Date: Sun, 21 Nov 2010 19:13:55 +0000 Subject: [PATCH] Check if CLOCK_MONOTONIC is supported before using clock_gettime. Fix the cmake check to see if -Wno-unused-result is supported by the compiler. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6453 8ced0084-cf51-0410-be5f-012b33b47a6e --- CMakeLists.txt | 2 +- Source/Core/Common/Src/Thread.h | 2 +- Source/Core/Common/Src/Timer.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9e8a21feaf..2273dc0402 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -42,7 +42,7 @@ include(CheckCXXCompilerFlag) # We call fread numerous times without checking return values. Hide the # corresponding compiler warnings if the compiler supports doing so. -CHECK_CXX_COMPILER_FLAG(-Wno-unused-result NO_UNUSED_RESULT) +CHECK_CXX_COMPILER_FLAG(-Wunused-result NO_UNUSED_RESULT) if(NO_UNUSED_RESULT) add_definitions(-Wno-unused-result) endif(NO_UNUSED_RESULT) diff --git a/Source/Core/Common/Src/Thread.h b/Source/Core/Common/Src/Thread.h index 04e6214b46..e93cf20160 100644 --- a/Source/Core/Common/Src/Thread.h +++ b/Source/Core/Common/Src/Thread.h @@ -63,7 +63,7 @@ //for (clock_gettime|gettimeofday) and struct time(spec|val) #include #include -#if !defined(_POSIX_TIMERS) || _POSIX_TIMERS == 0 +#if !defined(_POSIX_TIMERS) || _POSIX_TIMERS == 0 || !defined(_POSIX_MONOTONIC_CLOCK) #define USE_GETTIMEOFDAY #include #endif diff --git a/Source/Core/Common/Src/Timer.cpp b/Source/Core/Common/Src/Timer.cpp index 6583202f99..1533ae71b5 100644 --- a/Source/Core/Common/Src/Timer.cpp +++ b/Source/Core/Common/Src/Timer.cpp @@ -23,7 +23,7 @@ #include #else #include -#if !defined(_POSIX_TIMERS) || _POSIX_TIMERS == 0 +#if !defined(_POSIX_TIMERS) || _POSIX_TIMERS == 0 || !defined(_POSIX_MONOTONIC_CLOCK) #define USE_GETTIMEOFDAY #include #endif