Fix build on NetBSD (conflicting macro)

This commit is contained in:
Pierre Pronchery 2017-12-13 21:09:25 +01:00
parent c02d36a2f7
commit 6f0f4abe8c
2 changed files with 6 additions and 0 deletions

View File

@ -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]);
}

View File

@ -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);