]> granicus.if.org Git - libevent/commitdiff
compilation fixes for IRIX; from Nick Mathewson <nickm@freehaven.net>
authorNiels Provos <provos@gmail.com>
Tue, 22 Feb 2005 16:12:34 +0000 (16:12 +0000)
committerNiels Provos <provos@gmail.com>
Tue, 22 Feb 2005 16:12:34 +0000 (16:12 +0000)
svn:r132

acconfig.h
configure.in

index 834e810c9c87ed673288e4c3ff08ba87577a5b05..eab2a2759bab2b0b6d425a4b83768fa9afc1e561 100644 (file)
 /* Define if timeradd is defined in <sys/time.h> */
 #undef HAVE_TIMERADD
 #ifndef HAVE_TIMERADD
-#undef timerclear
-#undef timerisset
-#undef timercmp
-#define        timerclear(tvp)         (tvp)->tv_sec = (tvp)->tv_usec = 0
-#define        timerisset(tvp)         ((tvp)->tv_sec || (tvp)->tv_usec)
-#define        timercmp(tvp, uvp, cmp)                                         \
-       (((tvp)->tv_sec == (uvp)->tv_sec) ?                             \
-           ((tvp)->tv_usec cmp (uvp)->tv_usec) :                       \
-           ((tvp)->tv_sec cmp (uvp)->tv_sec))
+#undef timersub
 #define timeradd(tvp, uvp, vvp)                                                \
        do {                                                            \
                (vvp)->tv_sec = (tvp)->tv_sec + (uvp)->tv_sec;          \
        } while (0)
 #endif /* !HAVE_TIMERADD */
 
+#undef HAVE_TIMERCLEAR
+#ifndef HAVE_TIMERCLEAR
+#define        timerclear(tvp) (tvp)->tv_sec = (tvp)->tv_usec = 0
+#endif
+
+#undef HAVE_TIMERCMP
+#ifndef HAVE_TIMERCMP
+#undef timercmp
+#define        timercmp(tvp, uvp, cmp)                                         \
+       (((tvp)->tv_sec == (uvp)->tv_sec) ?                             \
+        ((tvp)->tv_usec cmp (uvp)->tv_usec) :                          \
+        ((tvp)->tv_sec cmp (uvp)->tv_sec))
+#endif
+
+#undef HAVE_TIMERISSET
+#ifndef HAVE_TIMERISSET
+#undef timerisset
+#define        timerisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec)
+#endif
+
 /* Define if TAILQ_FOREACH is defined in <sys/queue.h> */
 #undef HAVE_TAILQFOREACH
 #ifndef HAVE_TAILQFOREACH
@@ -62,3 +74,6 @@
        (listelm)->field.tqe_prev = &(elm)->field.tqe_next;             \
 } while (0)
 #endif /* TAILQ_FOREACH */
+
+/* Define to __FUNCTION__ or __file__ if your compiler doesn't have __func__ */
+#undef __func__
index 52c2a3ef49e69944782641e84219f7c882d5154d..c040b76772aa972ec9362a814a147b40bc63a35a 100644 (file)
@@ -63,6 +63,48 @@ if test "x$ac_cv_header_sys_time_h" = "xyes"; then
 )
 fi
 
+if test "x$ac_cv_header_sys_time_h" = "xyes"; then
+       AC_MSG_CHECKING(for timercmp in sys/time.h)
+       AC_EGREP_CPP(yes,
+[
+#include <sys/time.h>
+#ifdef timercmp
+ yes
+#endif
+],     [ AC_DEFINE(HAVE_TIMERCMP, 1,
+               [Define if timercmp is defined in <sys/time.h>])
+         AC_MSG_RESULT(yes)] ,AC_MSG_RESULT(no)
+)
+fi
+
+if test "x$ac_cv_header_sys_time_h" = "xyes"; then
+       AC_MSG_CHECKING(for timerclear in sys/time.h)
+       AC_EGREP_CPP(yes,
+[
+#include <sys/time.h>
+#ifdef timerclear
+ yes
+#endif
+],     [ AC_DEFINE(HAVE_TIMERCLEAR, 1,
+               [Define if timerclear is defined in <sys/time.h>])
+         AC_MSG_RESULT(yes)] ,AC_MSG_RESULT(no)
+)
+fi
+
+if test "x$ac_cv_header_sys_time_h" = "xyes"; then
+       AC_MSG_CHECKING(for timerisset in sys/time.h)
+       AC_EGREP_CPP(yes,
+[
+#include <sys/time.h>
+#ifdef timerisset
+ yes
+#endif
+],     [ AC_DEFINE(HAVE_TIMERISSET, 1,
+               [Define if timerisset is defined in <sys/time.h>])
+         AC_MSG_RESULT(yes)] ,AC_MSG_RESULT(no)
+)
+fi
+
 dnl Checks for typedefs, structures, and compiler characteristics.
 AC_C_CONST
 AC_C_INLINE
@@ -277,4 +319,19 @@ AC_TRY_COMPILE([
        [Define to unsigned int if you dont have it])]
 )
 
+AC_MSG_CHECKING([whether our compiler supports __func__])
+AC_TRY_COMPILE([],
+ [void foo() { const char *cp = __func__; }],
+ AC_MSG_RESULT([yes]),
+ AC_MSG_RESULT([no])
+ AC_MSG_CHECKING([whether our compiler supports __FUNCTION__])
+ AC_TRY_COMPILE([],
+   [void foo() { const char *cp = __FUNCTION__; }],
+   AC_MSG_RESULT([yes])
+   AC_DEFINE(__func__, __FUNCTION__,
+         [Define to appropriate substitue if compiler doesnt have __func__]),
+   AC_MSG_RESULT([no])
+   AC_DEFINE(__func__, __FILE__,
+         [Define to appropriate substitue if compiler doesnt have __func__])))
+
 AC_OUTPUT(Makefile test/Makefile sample/Makefile)