Skip to content

Commit

Permalink
#47: benchmark: unlock CLOCK_REALTIME on FreeBSD
Browse files Browse the repository at this point in the history
On FreeBSD, an extra macro must be defined to make CLOCK_REALTIME available.
  • Loading branch information
aklomp committed Nov 20, 2019
1 parent 5d06820 commit 42def00
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion test/benchmark.c
@@ -1,4 +1,12 @@
#define _POSIX_C_SOURCE 199309L // for clock_gettime()
// For clock_gettime(2):
#ifndef _POSIX_C_SOURCE
#define _POSIX_C_SOURCE 199309L
#endif

// For CLOCK_REALTIME on FreeBSD:
#ifndef _XOPEN_SOURCE
#define _XOPEN_SOURCE 600
#endif

#include <stdbool.h>
#include <sys/types.h>
Expand Down

0 comments on commit 42def00

Please sign in to comment.