Skip to content

Commit 804f72b

Browse files
committed
Get monotonic.h to build on older linux distros
1 parent e106dcc commit 804f72b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

setup.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,12 +212,14 @@ 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'
215217
cflags = os.environ.get(
216218
'OVERRIDE_CFLAGS', (
217-
'-Wextra {} -Wno-missing-field-initializers -Wall -Wstrict-prototypes -std=c11'
219+
'-Wextra {} -Wno-missing-field-initializers -Wall -Wstrict-prototypes -std={}11'
218220
' -pedantic-errors -Werror {} {} -fwrapv {} {} -pipe {} -fvisibility=hidden'
219221
).format(
220-
float_conversion,
222+
float_conversion, std,
221223
optimize,
222224
' '.join(sanitize_args),
223225
stack_protector,

0 commit comments

Comments
 (0)