mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-09-21 20:06:40 +00:00
Use clock_gettime on macOS
Is a Posix function and available on macOS since version 10.12, has better granularity than gettimeofday. Add missing header <time.h> where clock_gettime is specified. Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 2024 Wildfire Games.
|
||||
/* Copyright (C) 2025 Wildfire Games.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining
|
||||
* a copy of this software and associated documentation files (the
|
||||
@@ -43,6 +43,7 @@
|
||||
#endif
|
||||
#if OS_UNIX
|
||||
# include <unistd.h>
|
||||
# include <time.h>
|
||||
#endif
|
||||
|
||||
#if OS_UNIX || OS_WIN
|
||||
@@ -51,7 +52,7 @@
|
||||
# define HAVE_GETTIMEOFDAY 0
|
||||
#endif
|
||||
|
||||
#if (defined(_POSIX_TIMERS) && _POSIX_TIMERS > 0)
|
||||
#if (defined(_POSIX_TIMERS) && _POSIX_TIMERS > 0) || OS_MACOSX
|
||||
# define HAVE_CLOCK_GETTIME 1
|
||||
#else
|
||||
# define HAVE_CLOCK_GETTIME 0
|
||||
|
||||
Reference in New Issue
Block a user