From 303161777d617ffcf8c9cf76a7b6e84bf3655295 Mon Sep 17 00:00:00 2001 From: Mark Ellzey Date: Tue, 28 Jun 2016 10:37:24 -0700 Subject: [PATCH] [#372] check for errno.h --- CMakeLists.txt | 1 + configure.ac | 1 + event-config.h.cmake | 4 ++++ include/event2/util.h | 3 +++ 4 files changed, 9 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 98b669f4..86ac97af 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -288,6 +288,7 @@ CHECK_INCLUDE_FILE(sys/wait.h EVENT__HAVE_SYS_WAIT_H) CHECK_INCLUDE_FILE(sys/resource.h EVENT__HAVE_SYS_RESOURCE_H) CHECK_INCLUDE_FILE(sys/sysctl.h EVENT__HAVE_SYS_SYSCTL_H) CHECK_INCLUDE_FILE(sys/timerfd.h EVENT__HAVE_SYS_TIMERFD_H) +CHECK_INCLUDE_FILE(errno.h EVENT__HAVE_ERRNO_H) CHECK_FUNCTION_EXISTS_EX(epoll_create EVENT__HAVE_EPOLL) diff --git a/configure.ac b/configure.ac index 215c853e..904cd1aa 100644 --- a/configure.ac +++ b/configure.ac @@ -243,6 +243,7 @@ AC_CHECK_HEADERS([ \ sys/timerfd.h \ sys/uio.h \ sys/wait.h \ + errno.h \ ]) AC_CHECK_HEADERS(sys/sysctl.h, [], [], [ diff --git a/event-config.h.cmake b/event-config.h.cmake index 76e0d1f9..b47a7c4c 100644 --- a/event-config.h.cmake +++ b/event-config.h.cmake @@ -382,6 +382,9 @@ /* Define to 1 if you have the header file. */ #cmakedefine EVENT__HAVE_SYS_WAIT_H +/* Define to 1 if you have the header file. */ +#cmakedefine EVENT__HAVE_ERRNO_H + /* Define if TAILQ_FOREACH is defined in */ #cmakedefine EVENT__HAVE_TAILQFOREACH @@ -394,6 +397,7 @@ /* Define if timercmp is defined in */ #cmakedefine EVENT__HAVE_TIMERCMP + /* Define to 1 if you have the `timerfd_create' function. */ #cmakedefine EVENT__HAVE_TIMERFD_CREATE diff --git a/include/event2/util.h b/include/event2/util.h index 3936786e..2c43e30e 100644 --- a/include/event2/util.h +++ b/include/event2/util.h @@ -71,6 +71,9 @@ extern "C" { #include #endif #else +#ifdef EVENT__HAVE_ERRNO_H +#include +#endif #include #endif -- 2.40.0