Fix building with compilers that dont support __has_include
This commit is contained in:
parent
e350822f5e
commit
cab949a939
5
glfw/backend_utils.h
vendored
5
glfw/backend_utils.h
vendored
@ -29,10 +29,15 @@
|
||||
#include <unistd.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#ifdef __has_include
|
||||
#if __has_include(<sys/eventfd.h>)
|
||||
#define HAS_EVENT_FD
|
||||
#include <sys/eventfd.h>
|
||||
#endif
|
||||
#else
|
||||
#define HAS_EVENT_FD
|
||||
#include <sys/eventfd.h>
|
||||
#endif
|
||||
|
||||
typedef unsigned long long id_type;
|
||||
typedef void(*watch_callback_func)(int, int, void*);
|
||||
|
||||
4
glfw/wl_init.c
vendored
4
glfw/wl_init.c
vendored
@ -41,11 +41,15 @@
|
||||
#include <fcntl.h>
|
||||
#include <wayland-client.h>
|
||||
// Needed for the BTN_* defines
|
||||
#ifdef __has_include
|
||||
#if __has_include(<linux/input.h>)
|
||||
#include <linux/input.h>
|
||||
#elif __has_include(<dev/evdev/input.h>)
|
||||
#include <dev/evdev/input.h>
|
||||
#endif
|
||||
#else
|
||||
#include <linux/input.h>
|
||||
#endif
|
||||
|
||||
|
||||
static inline int min(int n1, int n2)
|
||||
|
||||
@ -10,6 +10,7 @@
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#ifdef __has_include
|
||||
#if __has_include(<sys/signalfd.h>)
|
||||
#define HAS_SIGNAL_FD
|
||||
#include <sys/signalfd.h>
|
||||
@ -19,6 +20,12 @@
|
||||
#define HAS_EVENT_FD
|
||||
#include <sys/eventfd.h>
|
||||
#endif
|
||||
#else
|
||||
#define HAS_SIGNAL_FD
|
||||
#include <sys/signalfd.h>
|
||||
#define HAS_EVENT_FD
|
||||
#include <sys/eventfd.h>
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
#ifndef HAS_EVENT_FD
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user