if test $ol_cv_header_stdc = yes; then
# /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <ctype.h>
+#include <stdlib.h>
#ifndef HAVE_EBCDIC
# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
#define NULL (void*)0
#endif
+#ifdef __STDC__
+static void *task(void *p)
+#else
static void *task(p)
void *p;
+#endif
{
return (void *) (p == NULL);
}
AC_DEFUN([OL_PTHREAD_TEST_PROGRAM],
[AC_LANG_SOURCE([OL_PTHREAD_TEST_INCLUDES
+#ifdef __STDC__
+int main(int argc, char **argv)
+#else
int main(argc, argv)
int argc;
char **argv;
+#endif
{
OL_PTHREAD_TEST_FUNCTION
}
#include <sys/types.h>
#include <regex.h>
static char *pattern, *string;
-main()
+int main(void)
{
int rc;
regex_t re;
[AC_CACHE_CHECK([if toupper() requires islower()],ol_cv_c_upper_lower,[
AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <ctype.h>
-main()
+#include <stdlib.h>
+int main(void)
{
if ('C' == toupper('C'))
exit(0);
]])],[ol_cv_nonposix_strerror_r=yes],[ol_cv_nonposix_strerror_r=no])
else
AC_RUN_IFELSE([AC_LANG_SOURCE([[
- main() {
+ int main(void) {
char buf[100];
buf[0] = 0;
strerror_r( 1, buf, sizeof buf );
AC_CHECK_HEADERS( sys/epoll.h )
if test "${ac_cv_header_sys_epoll_h}" = yes; then
AC_MSG_CHECKING(for epoll system call)
- AC_RUN_IFELSE([AC_LANG_SOURCE([[int main(int argc, char **argv)
+ AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdlib.h>
+#ifdef HAVE_SYS_POLL_H
+#include <sys/epoll.h>
+#endif
+int main(int argc, char **argv)
{
int epfd = epoll_create(256);
exit (epfd == -1 ? 1 : 0);
dnl pthread_create() in -lpthread (many)
dnl pthread_create() in -lc_r (FreeBSD)
dnl
- dnl Check pthread (draft4) flags (depreciated)
+ dnl Check pthread (draft4) flags (deprecated)
dnl pthread_create() with -threads (OSF/1)
dnl
- dnl Check pthread (draft4) libraries (depreciated)
+ dnl Check pthread (draft4) libraries (deprecated)
dnl pthread_mutex_unlock() in -lpthreads -lmach -lexc -lc_r (OSF/1)
dnl pthread_mutex_lock() in -lpthreads -lmach -lexc (OSF/1)
dnl pthread_mutex_trylock() in -lpthreads -lexc (OSF/1)
ol_link_threads=posix
ol_link_pthreads=""
fi
-
+
dnl OL_PTHREAD_TRY([-mt], [ol_cv_pthread_mt])
OL_PTHREAD_TRY([-kthread], [ol_cv_pthread_kthread])
OL_PTHREAD_TRY([-pthread], [ol_cv_pthread_pthread])
dnl save the flags
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#include <pthread.h>
-#ifndef NULL
-#define NULL (void*)0
-#endif
-]], [[pthread_detach(NULL);]])],[ol_cv_func_pthread_detach=yes],[ol_cv_func_pthread_detach=no])
+pthread_t thread;
+]], [[pthread_detach(thread);]])],[ol_cv_func_pthread_detach=yes],[ol_cv_func_pthread_detach=no])
])
if test $ol_cv_func_pthread_detach = no ; then
AC_CACHE_CHECK([if select yields when using pthreads],
ol_cv_pthread_select_yields,[
AC_RUN_IFELSE([AC_LANG_SOURCE([[
+#define _XOPEN_SOURCE 500 /* For pthread_setconcurrency() on glibc */
+#include <stdlib.h>
+#include <stdio.h>
#include <sys/types.h>
#include <sys/time.h>
#include <unistd.h>
static int fildes[2];
+#ifdef __STDC__
+static void *task(void *p)
+#else
static void *task(p)
void *p;
+#endif
{
int i;
struct timeval tv;
exit(0); /* if we exit here, the select blocked the whole process */
}
+#ifdef __STDC__
+int main(int argc, char **argv)
+#else
int main(argc, argv)
int argc;
char **argv;
+#endif
{
pthread_t t;