Define alias for le16toh on macOS

Fixes #25
This commit is contained in:
Eric Jiang 2022-12-02 21:50:04 -08:00
parent f61a8b5e09
commit b902381221

View File

@ -53,6 +53,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define WEIGH_REPORT_SIZE 6
#define CONTROL_REPORT_SIZE 2
// `le16toh` is not available on MacOS (as of 12.6) but we can replace it with
// a similar function.
#if defined(__APPLE__)
#include <libkern/OSByteOrder.h>
#define le16toh(x) OSSwapLittleToHostInt16(x)
#endif
//
// **find_scale** takes a libusb device list and finds the first USB device
// that matches a device listed in scales.h.