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
This commit is contained in:
Glenn Rice 2010-11-21 19:13:55 +00:00
parent b8218726aa
commit 39a4781a5f
3 changed files with 3 additions and 3 deletions

View File

@ -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)

View File

@ -63,7 +63,7 @@
//for (clock_gettime|gettimeofday) and struct time(spec|val)
#include <unistd.h>
#include <time.h>
#if !defined(_POSIX_TIMERS) || _POSIX_TIMERS == 0
#if !defined(_POSIX_TIMERS) || _POSIX_TIMERS == 0 || !defined(_POSIX_MONOTONIC_CLOCK)
#define USE_GETTIMEOFDAY
#include <sys/time.h>
#endif

View File

@ -23,7 +23,7 @@
#include <sys/timeb.h>
#else
#include <unistd.h>
#if !defined(_POSIX_TIMERS) || _POSIX_TIMERS == 0
#if !defined(_POSIX_TIMERS) || _POSIX_TIMERS == 0 || !defined(_POSIX_MONOTONIC_CLOCK)
#define USE_GETTIMEOFDAY
#include <sys/time.h>
#endif