From 6f0f4abe8c08fbd4a90f04e84b3e417b5f121ac6 Mon Sep 17 00:00:00 2001 From: Pierre Pronchery Date: Wed, 13 Dec 2017 21:09:25 +0100 Subject: [PATCH] Fix build on NetBSD (conflicting macro) --- client/util.c | 3 +++ client/util.h | 3 +++ 2 files changed, 6 insertions(+) diff --git a/client/util.c b/client/util.c index 7e6b407..c7d8134 100644 --- a/client/util.c +++ b/client/util.c @@ -704,6 +704,9 @@ void xor(unsigned char *dst, unsigned char *src, size_t len) { int32_t le24toh (uint8_t data[3]) { return (data[2] << 16) | (data[1] << 8) | data[0]; } +#ifdef le32toh +# undef le32toh +#endif uint32_t le32toh (uint8_t *data) { return (uint32_t)( (data[3]<<24) | (data[2]<<16) | (data[1]<<8) | data[0]); } diff --git a/client/util.h b/client/util.h index f4ea49d..c7dbc7e 100644 --- a/client/util.h +++ b/client/util.h @@ -82,7 +82,10 @@ void wiegand_add_parity(uint8_t *target, uint8_t *source, uint8_t length); void xor(unsigned char *dst, unsigned char *src, size_t len); int32_t le24toh(uint8_t data[3]); +#ifdef le32toh +# undef le32toh #endif +uint32_t le32toh (uint8_t *data); void rol(uint8_t *data, const size_t len); void clean_ascii(unsigned char *buf, size_t len);