mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 14:19:46 -06:00
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:
@ -42,7 +42,7 @@ include(CheckCXXCompilerFlag)
|
|||||||
|
|
||||||
# We call fread numerous times without checking return values. Hide the
|
# We call fread numerous times without checking return values. Hide the
|
||||||
# corresponding compiler warnings if the compiler supports doing so.
|
# 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)
|
if(NO_UNUSED_RESULT)
|
||||||
add_definitions(-Wno-unused-result)
|
add_definitions(-Wno-unused-result)
|
||||||
endif(NO_UNUSED_RESULT)
|
endif(NO_UNUSED_RESULT)
|
||||||
|
@ -63,7 +63,7 @@
|
|||||||
//for (clock_gettime|gettimeofday) and struct time(spec|val)
|
//for (clock_gettime|gettimeofday) and struct time(spec|val)
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <time.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
|
#define USE_GETTIMEOFDAY
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#endif
|
#endif
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
#include <sys/timeb.h>
|
#include <sys/timeb.h>
|
||||||
#else
|
#else
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#if !defined(_POSIX_TIMERS) || _POSIX_TIMERS == 0
|
#if !defined(_POSIX_TIMERS) || _POSIX_TIMERS == 0 || !defined(_POSIX_MONOTONIC_CLOCK)
|
||||||
#define USE_GETTIMEOFDAY
|
#define USE_GETTIMEOFDAY
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user