13 #if !defined(OS_LINUX) && !defined(OS_MAC)
14 #error Your OS is not supported. Edit os.h if you want to compile anyway.
21 #ifndef _DEFAULT_SOURCE
22 #define _DEFAULT_SOURCE
31 #include <linux/uinput.h>
32 #include <linux/usbdevice_fs.h>
34 #ifndef UINPUT_VERSION
35 #define UINPUT_VERSION 2
40 #define euid_guard_start
41 #define euid_guard_stop
47 #define __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES 1
48 #include <AssertMacros.h>
50 #include <Availability.h>
51 #include <Carbon/Carbon.h>
52 #include <IOKit/IOMessage.h>
53 #include <IOKit/hid/IOHIDDevicePlugin.h>
54 #include <IOKit/hid/IOHIDLib.h>
55 #include <IOKit/hidsystem/IOHIDLib.h>
56 #include <IOKit/hidsystem/ev_keymap.h>
57 #include <IOKit/usb/IOUSBLib.h>
58 #include <IOKit/usb/USB.h>
60 typedef IOHIDDeviceDeviceInterface** hid_dev_t;
61 typedef IOUSBDeviceInterface182** usb_dev_t;
62 typedef IOUSBInterfaceInterface183** usb_iface_t;
66 extern pthread_mutex_t _euid_guard;
67 #define euid_guard_start pthread_mutex_lock(&_euid_guard)
68 #define euid_guard_stop pthread_mutex_unlock(&_euid_guard)
72 void *memrchr(
const void *s,
int c,
size_t n);
74 #if __MAC_OS_X_VERSION_MAX_ALLOWED < 101200
75 typedef int clockid_t;
76 #define CLOCK_MONOTONIC 1
79 #define TIMER_ABSTIME 1
81 int clock_gettime(clockid_t clk_id,
struct timespec *tp);
82 int clock_nanosleep(clockid_t clock_id,
int flags,
const struct timespec *rqtp,
struct timespec *rmtp);