CMake/Modules/CheckForPthreads.c
David Benjamin b4f17e5b44 FindThreads: Fix pthreads detection with -Wmissing-prototypes
If the project builds with `-Wmissing-prototypes` to catch unnecessarily
exported symbols, `CheckForPthreads.c` will fail to build.  Fix this by
marking `start_routine` as static.

Fixes: #25886
2024-04-22 09:51:41 -04:00

16 lines
280 B
C

#include <pthread.h>
static void* start_routine(void* args)
{
return args;
}
int main(void)
{
/* This is a compile and link test, no code to actually run things. */
pthread_t thread;
pthread_create(&thread, 0, start_routine, 0);
pthread_join(thread, 0);
return 0;
}