mirror of
https://gitea.wildfiregames.com/0ad/0ad
synced 2026-06-16 05:13:58 -07: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:
parent
a03268ebae
commit
2e6f62dcf9
1 changed files with 3 additions and 2 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue