Skip to content

Commit 2cee3a8

Browse files
committed
Better fix for getting clock_gettime() from time.h
Fixes #2169
1 parent 804f72b commit 2cee3a8

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

setup.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -212,14 +212,13 @@ def init_env(
212212
cppflags = shlex.split(cppflags)
213213
for el in extra_logging:
214214
cppflags.append('-DDEBUG_{}'.format(el.upper().replace('-', '_')))
215-
# gnu11 is needed to get monotonic.h to build on older Linux distros
216-
std = 'c' if is_macos or ccver[0] >= 5 else 'gnu'
215+
# _POSIX_C_SOURCE is needed for clock_gettime() in monotonic.h
217216
cflags = os.environ.get(
218217
'OVERRIDE_CFLAGS', (
219-
'-Wextra {} -Wno-missing-field-initializers -Wall -Wstrict-prototypes -std={}11'
218+
'-Wextra {} -Wno-missing-field-initializers -Wall -Wstrict-prototypes -D_POSIX_C_SOURCE=200809L -std=c11'
220219
' -pedantic-errors -Werror {} {} -fwrapv {} {} -pipe {} -fvisibility=hidden'
221220
).format(
222-
float_conversion, std,
221+
float_conversion,
223222
optimize,
224223
' '.join(sanitize_args),
225224
stack_protector,

0 commit comments

Comments
 (0)