Skip to content

Commit 7fa3959

Browse files
tbitcsoz-agent
andcommitted
fix(benchmarks): add _POSIX_C_SOURCE to expose CLOCK_MONOTONIC_RAW
-std=c17 without POSIX feature macros doesn't expose CLOCK_MONOTONIC or CLOCK_MONOTONIC_RAW from <time.h>. Adding _POSIX_C_SOURCE=200809L enables the POSIX.1-2008 extensions which include these constants. Co-Authored-By: Oz <oz-agent@warp.dev>
1 parent c4fae7c commit 7fa3959

2 files changed

Lines changed: 2 additions & 0 deletions

File tree

  • tests/benchmarks

tests/benchmarks/kalman_benchmark/src/main.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
* flag is off, so clock_gettime resolves to glibc and returns real
2020
* host time with nanosecond resolution.
2121
*/
22+
#define _POSIX_C_SOURCE 200809L
2223
#include <time.h>
2324
static inline uint64_t bench_ns(void)
2425
{

tests/benchmarks/pid_benchmark/src/main.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include <arbiter/arbiter.h>
2222
#include "arbiter_model.h"
2323

24+
#define _POSIX_C_SOURCE 200809L
2425
#include <time.h>
2526
static inline uint64_t bench_ns(void)
2627
{

0 commit comments

Comments
 (0)