From cab949a93911941bfd44f996e02eaad8498683d9 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 29 Jul 2019 09:44:05 +0530 Subject: [PATCH] Fix building with compilers that dont support __has_include --- glfw/backend_utils.h | 5 +++++ glfw/wl_init.c | 4 ++++ kitty/loop-utils.h | 7 +++++++ 3 files changed, 16 insertions(+) diff --git a/glfw/backend_utils.h b/glfw/backend_utils.h index f69fe722ddf..49e3c0d3c2e 100644 --- a/glfw/backend_utils.h +++ b/glfw/backend_utils.h @@ -29,10 +29,15 @@ #include #include +#ifdef __has_include #if __has_include() #define HAS_EVENT_FD #include #endif +#else +#define HAS_EVENT_FD +#include +#endif typedef unsigned long long id_type; typedef void(*watch_callback_func)(int, int, void*); diff --git a/glfw/wl_init.c b/glfw/wl_init.c index 074a3c5b98d..3f3c8f00f77 100644 --- a/glfw/wl_init.c +++ b/glfw/wl_init.c @@ -41,11 +41,15 @@ #include #include // Needed for the BTN_* defines +#ifdef __has_include #if __has_include() #include #elif __has_include() #include #endif +#else +#include +#endif static inline int min(int n1, int n2) diff --git a/kitty/loop-utils.h b/kitty/loop-utils.h index 128b86e4b51..efe4cf69306 100644 --- a/kitty/loop-utils.h +++ b/kitty/loop-utils.h @@ -10,6 +10,7 @@ #include #include +#ifdef __has_include #if __has_include() #define HAS_SIGNAL_FD #include @@ -19,6 +20,12 @@ #define HAS_EVENT_FD #include #endif +#else +#define HAS_SIGNAL_FD +#include +#define HAS_EVENT_FD +#include +#endif typedef struct { #ifndef HAS_EVENT_FD