summaryrefslogtreecommitdiff
path: root/m4/ax_pthread.m4
diff options
context:
space:
mode:
authorPeter Simons <simons@cryp.to>2009-12-30 18:46:53 +0100
committerPeter Simons <simons@cryp.to>2010-01-05 14:02:02 +0100
commit7a6c511965489c38f5d3bef4afe113e3fe11c2ac (patch)
tree68f72d3ac4f160405b2f3a2ba4e92ea987342610 /m4/ax_pthread.m4
parent4339f0a8a2803e1e954f461319b39c7f1a1f60fb (diff)
downloadautoconf-archive-7a6c511965489c38f5d3bef4afe113e3fe11c2ac.tar.gz
AX_PTHREAD: minor changes to the AC_TRY_LINK command so that the code compiles when -Wall and -Werror are set
Diffstat (limited to 'm4/ax_pthread.m4')
-rw-r--r--m4/ax_pthread.m413
1 files changed, 9 insertions, 4 deletions
diff --git a/m4/ax_pthread.m4 b/m4/ax_pthread.m4
index 8a1d24c..37502dd 100644
--- a/m4/ax_pthread.m4
+++ b/m4/ax_pthread.m4
@@ -192,10 +192,15 @@ for flag in $ax_pthread_flags; do
# pthread_cleanup_push because it is one of the few pthread
# functions on Solaris that doesn't have a non-functional libc stub.
# We try pthread_create on general principles.
- AC_TRY_LINK([#include <pthread.h>],
- [pthread_t th; pthread_join(th, 0);
- pthread_attr_init(0); pthread_cleanup_push(0, 0);
- pthread_create(0,0,0,0); pthread_cleanup_pop(0); ],
+ AC_TRY_LINK([#include <pthread.h>
+ static void routine(void* a) {a=0;}
+ static void* start_routine(void* a) {return a;}],
+ [pthread_t th; pthread_attr_t attr;
+ pthread_join(th, 0);
+ pthread_attr_init(&attr);
+ pthread_cleanup_push(routine, 0);
+ pthread_create(&th,0,start_routine,0);
+ pthread_cleanup_pop(0); ],
[ax_pthread_ok=yes])
LIBS="$save_LIBS"