platform detection
parent
9a00a29af6
commit
e323f42ea3
@ -0,0 +1,34 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#if defined(__linux__)
|
||||||
|
#define PLATFORM_LINUX
|
||||||
|
#define EVENTLOOP_EPOLL
|
||||||
|
|
||||||
|
#elif defined(__APPLE__) && defined(__MACH__)
|
||||||
|
#define PLATFORM_OSX
|
||||||
|
#define EVENTLOOP_KQUEUE
|
||||||
|
|
||||||
|
#elif defined(__FreeBSD__)
|
||||||
|
#define PLATFORM_BSD
|
||||||
|
#define PLATFORM_FREEBSD
|
||||||
|
#define EVENTLOOP_KQUEUE
|
||||||
|
|
||||||
|
#elif defined(__NetBSD__)
|
||||||
|
#define PLATFORM_BSD
|
||||||
|
#define PLATFORM_NETBSD
|
||||||
|
#define EVENTLOOP_KQUEUE
|
||||||
|
|
||||||
|
#elif defined(__OpenBSD__)
|
||||||
|
#define PLATFORM_BSD
|
||||||
|
#define PLATFORM_OPENBSD
|
||||||
|
#define EVENTLOOP_KQUEUE
|
||||||
|
|
||||||
|
#elif defined(__DragonFly__)
|
||||||
|
#define PLATFORM_BSD
|
||||||
|
#define PLATFORM_DRAGONFLY
|
||||||
|
#define EVENTLOOP_KQUEUE
|
||||||
|
|
||||||
|
#else
|
||||||
|
#error "Failed to detect supported platform"
|
||||||
|
|
||||||
|
#endif
|
||||||
Loading…
Reference in New Issue