Skip to content

Commit 2118eed

Browse files
committed
Check if valgrind.h exists
1 parent 19d6a93 commit 2118eed

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

demo/test.c

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,17 @@
55
#include "s_mp_rand_jenkins.c"
66

77
/* TODO: Make it an environment variable via main.yml?
8-
This is for testing only, so no to add checks to the build process. */
9-
#include <valgrind/valgrind.h>
8+
This is for testing only, so no reason to add checks to the build process. */
9+
#ifdef __has_include
10+
# if __has_include (<valgrind/valgrind.h>)
11+
# include <valgrind/valgrind.h>
12+
# else
13+
# define RUNNING_ON_VALGRIND 1
14+
# endif
15+
#else
16+
# define RUNNING_ON_VALGRIND 1
17+
#endif
18+
1019

1120
static long rand_long(void)
1221
{

0 commit comments

Comments
 (0)