diff options
author | Yonggang Luo <luoyonggang@gmail.com> | 2022-02-19 13:19:08 +0800 |
---|---|---|
committer | Marge Bot <emma+marge@anholt.net> | 2022-06-09 17:23:34 +0000 |
commit | b2ddec4e98fea9b824e7258468e5b5da9ba848b0 (patch) | |
tree | 0f86a76ffc46f5a9a31a55e9db423f48c3358381 /meson.build | |
parent | fe01757ddf067414646032f5fd7ffc5a4d332591 (diff) | |
download | mesa-b2ddec4e98fea9b824e7258468e5b5da9ba848b0.tar.gz |
c11: Implement c11/time.h with c11/impl/time.c
Create c11/time.h instead of put timespec_get in `c11/threads.h`
Creating impl folder is used to avoid `#include <time.h>` point the c11/time.h file
Detecting if `struct timespec` present with meson
Define TIME_UTC in `c11/time.h` instead `c11/threads.h`
Define `struct timespec` in `c11/time.h` when not present.
Implement timespec_get in c11/impl/time.c instead threads.h
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15497>
Diffstat (limited to 'meson.build')
-rw-r--r-- | meson.build | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/meson.build b/meson.build index d76cbe11236..c1f3e06941a 100644 --- a/meson.build +++ b/meson.build @@ -1453,6 +1453,10 @@ foreach f, prefix: functions_to_detect endif endforeach +if cc.has_header_symbol('time.h', 'struct timespec') + pre_args += '-DHAVE_STRUCT_TIMESPEC' +endif + if cc.has_header_symbol('errno.h', 'program_invocation_name', args : '-D_GNU_SOURCE') pre_args += '-DHAVE_PROGRAM_INVOCATION_NAME' |