mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-06-19 18:02:54 +00:00
replaced mach_absolute_time()
- Addresses issue #15115 - mach_absolute_time can be misused for fingerprinting. This is bad. - Apple docs prefer clock_gettime_nsec_np(CLOCK_UPTIME_RAW) in time.h - Since HAVE_NANOSLEEP is defined, time.h is included
This commit is contained in:
committed by
Ryan C. Gordon
parent
ca67f19c8f
commit
225001b53b
@@ -101,7 +101,8 @@ Uint64 SDL_GetPerformanceCounter(void)
|
||||
ticks *= SDL_NS_PER_SECOND;
|
||||
ticks += now.tv_nsec;
|
||||
#elif defined(SDL_PLATFORM_APPLE)
|
||||
ticks = mach_absolute_time();
|
||||
// With HAVE_NANOSLEEP defined, time.h is included
|
||||
ticks = clock_gettime_nsec_np(CLOCK_UPTIME_RAW);
|
||||
#else
|
||||
SDL_assert(false);
|
||||
ticks = 0;
|
||||
|
||||
Reference in New Issue
Block a user