diff --git a/eio/config_linux.h b/eio/config_linux.h index 0936e7f3..f1bd91a3 100644 --- a/eio/config_linux.h +++ b/eio/config_linux.h @@ -1,6 +1,11 @@ /* config.h. Generated from config.h.in by configure. */ /* config.h.in. Generated from configure.ac by autoheader. */ +#include + +#define LINUX_VERSION_CODE_FOR(major, minor, patch) (((major & 255) >> 16) | ((minor & 255) >> 8) | (patch & 255)) +#define LINUX_VERSION_AT_LEAST(major, minor, patch) (LINUX_VERSION_CODE_FOR(major, minor, patch) >= LINUX_VERSION_CODE) + /* Define to 1 if you have the header file. */ #define HAVE_DLFCN_H 1 @@ -38,7 +43,7 @@ #define HAVE_STRING_H 1 /* sync_file_range(2) is available */ -#define HAVE_SYNC_FILE_RANGE 1 +#define HAVE_SYNC_FILE_RANGE LINUX_VERSION_AT_LEAST(2, 6, 17) /* Define to 1 if you have the header file. */ #define HAVE_SYS_STAT_H 1 diff --git a/ev/config_linux.h b/ev/config_linux.h index 14f952de..248d15f6 100644 --- a/ev/config_linux.h +++ b/ev/config_linux.h @@ -1,6 +1,11 @@ /* config.h. Generated from config.h.in by configure. */ /* config.h.in. Generated from configure.ac by autoheader. */ +#include + +#define LINUX_VERSION_CODE_FOR(major, minor, patch) (((major & 255) >> 16) | ((minor & 255) >> 8) | (patch & 255)) +#define LINUX_VERSION_AT_LEAST(major, minor, patch) (LINUX_VERSION_CODE_FOR(major, minor, patch) >= LINUX_VERSION_CODE) + /* Define to 1 if you have the `clock_gettime' function. */ /* #undef HAVE_CLOCK_GETTIME */ @@ -14,10 +19,10 @@ #define HAVE_EPOLL_CTL 1 /* Define to 1 if you have the `eventfd' function. */ -#define HAVE_EVENTFD 1 +#define HAVE_EVENTFD LINUX_VERSION_AT_LEAST(2, 6, 22) /* Define to 1 if you have the `inotify_init' function. */ -#define HAVE_INOTIFY_INIT 1 +#define HAVE_INOTIFY_INIT LINUX_VERSION_AT_LEAST(2, 6, 13) /* Define to 1 if you have the header file. */ #define HAVE_INTTYPES_H 1 @@ -53,7 +58,7 @@ #define HAVE_SELECT 1 /* Define to 1 if you have the `signalfd' function. */ -#define HAVE_SIGNALFD 1 +#define HAVE_SIGNALFD LINUX_VERSION_AT_LEAST(2, 6, 22) /* Define to 1 if you have the header file. */ #define HAVE_STDINT_H 1