From: Carlo Marcelo Arenas Belón Date: Wed, 15 Aug 2018 20:57:01 +0000 (-0700) Subject: test: make sure pthread is defined X-Git-Tag: release-2.1.9-beta^2~93 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7d6c88dd11ae1ab4ec8d4266854185f88884e271;p=libevent test: make sure pthread is defined avoid warnings with any modern C99 compiler due to implicit function declaration for pthread_create, as shown by the following : test/regress_dns.c:2226:2: warning: implicit declaration of function 'pthread_create' is invalid in C99 [-Wimplicit-function-declaration] THREAD_START(thread[0], race_base_run, &rp); ^ test/regress_thread.h:35:2: note: expanded from macro 'THREAD_START' pthread_create(&(threadvar), NULL, fn, arg) ^ test/regress_dns.c:2226:2: warning: this function declaration is not a prototype [-Wstrict-prototypes] test/regress_thread.h:35:2: note: expanded from macro 'THREAD_START' pthread_create(&(threadvar), NULL, fn, arg) ^ $ clang --version Apple LLVM version 9.1.0 (clang-902.0.39.2) Target: x86_64-apple-darwin17.7.0 Thread model: posix InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin Closes: #686 (cherry-picked) (cherry picked from commit 7af974eeaa7e5cf2f73e3176782c5a788a74f08e) --- diff --git a/test/regress_thread.h b/test/regress_thread.h index 831b51e5..db0d8d19 100644 --- a/test/regress_thread.h +++ b/test/regress_thread.h @@ -28,6 +28,7 @@ #define REGRESS_THREAD_H_INCLUDED_ #ifdef EVENT__HAVE_PTHREADS +#include #define THREAD_T pthread_t #define THREAD_FN void * #define THREAD_RETURN() return (NULL)