Add MacOS support
This commit is contained in:
parent
806daa7098
commit
e5795fd6b9
|
|
@ -0,0 +1,19 @@
|
|||
#pragma once
|
||||
|
||||
#if defined(__APPLE__)
|
||||
#include <libkern/OSByteOrder.h>
|
||||
|
||||
#define htole16(x) OSSwapHostToLittleInt16(x)
|
||||
#define htole32(x) OSSwapHostToLittleInt32(x)
|
||||
#define htole64(x) OSSwapHostToLittleInt64(x)
|
||||
|
||||
#define le16toh(x) OSSwapLittleToHostInt16(x)
|
||||
#define le32toh(x) OSSwapLittleToHostInt32(x)
|
||||
#define le64toh(x) OSSwapLittleToHostInt64(x)
|
||||
|
||||
#elif defined(__linux__)
|
||||
#include <endian.h> // or #include <sys/endian.h> on older systems
|
||||
|
||||
#else
|
||||
#error "Endian conversion functions not defined for this platform"
|
||||
#endif
|
||||
|
|
@ -42,6 +42,7 @@
|
|||
|
||||
#include "crc32.h"
|
||||
#include "hid_ids.h"
|
||||
#include "endian_compat.h"
|
||||
|
||||
#define GRAVITY_G (9.806f)
|
||||
|
||||
|
|
|
|||
|
|
@ -36,6 +36,8 @@
|
|||
|
||||
#include "crc32.h"
|
||||
#include "hid_ids.h"
|
||||
#include "endian_compat.h"
|
||||
|
||||
|
||||
#ifndef NDEBUG
|
||||
#define device_mcu_error(msg) fprintf(stderr, "ERROR: %s\n", msg)
|
||||
|
|
|
|||
Loading…
Reference in New Issue