Skip to content

Commit

Permalink
compat: include byteswap.h instead of endian.h
Browse files Browse the repository at this point in the history
This fixes the following compile error on systems using musl libc:

net_io.c: In function 'bam32ToDouble':
net_io.c:1412:32: error: implicit declaration of function '__bswap_32'; did you mean '__bswap32'? [-Werror=implicit-function-declaration]
 1412 |     return (double) ((int32_t) __bswap_32(bam) * 8.38190317153931E-08);
      |                                ^~~~~~~~~~
      |                                __bswap32
net_io.c: In function 'decodeHulcMessage':
net_io.c:1440:40: error: implicit declaration of function '__bswap_16'; did you mean '__bswap16'? [-Werror=implicit-function-declaration]
 1440 |         Modes.receiver.antenna_flags = __bswap_16(hsm.status.flags);
      |                                        ^~~~~~~~~~
      |                                        __bswap16

Compile-tested on both glibc and musl systems.

Signed-off-by: Stijn Tintel <[email protected]>
  • Loading branch information
stintel committed May 28, 2024
1 parent 85810ce commit aa64b1c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion compat/compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

#else // other platforms

# include <endian.h>
# include <byteswap.h>

#endif

Expand Down

0 comments on commit aa64b1c

Please sign in to comment.