diff --git a/test/cfg/std.c b/test/cfg/std.c index 9637f322f..b642ce477 100644 --- a/test/cfg/std.c +++ b/test/cfg/std.c @@ -23,7 +23,9 @@ #include #include #include +#ifndef __STDC_NO_THREADS__ #include +#endif #include #include @@ -4364,6 +4366,7 @@ void nullPointer_system(char *c) (void)system(c); } +#ifndef __STDC_NO_THREADS__ int nullPointer_mtx_timedlock( mtx_t *restrict mutex, const struct timespec *restrict time_point ) { // cppcheck-suppress nullPointer @@ -4372,6 +4375,7 @@ int nullPointer_mtx_timedlock( mtx_t *restrict mutex, const struct timespec *res (void) mtx_timedlock(mutex, NULL); return mtx_timedlock(mutex, time_point); } +#endif void uninitvar_zonetime(void) { diff --git a/test/cfg/std.cpp b/test/cfg/std.cpp index 5f10bdeb1..431f6b21a 100644 --- a/test/cfg/std.cpp +++ b/test/cfg/std.cpp @@ -26,7 +26,9 @@ #include #include #include -#include +#ifndef __STDC_NO_THREADS__ + #include +#endif #include #include #include @@ -3661,6 +3663,8 @@ void uninitvar_system(void) (void)std::system(c); } +#ifndef __STDC_NO_THREADS__ + void nullPointer_mtx_destroy( mtx_t *mutex ) { // cppcheck-suppress nullPointer @@ -3690,6 +3694,7 @@ int nullPointer_mtx_timedlock( mtx_t *mutex, const struct timespec *time_point ) (void) mtx_timedlock(mutex, nullptr); return mtx_timedlock(mutex, time_point); } +#endif void nullPointer_system(char *c) {