Skip to content

Commit

Permalink
IIOD: Define __bswap_constant_16/32 if not already defined
Browse files Browse the repository at this point in the history
The musl C library does not define these macros.

Signed-off-by: Paul Cercueil <[email protected]>
  • Loading branch information
Paul Cercueil committed Jul 1, 2016
1 parent 5472091 commit 9c6c6a4
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions iiod/iiod.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,17 @@

#define IIOD_PORT 30431

#ifndef __bswap_constant_16
#define __bswap_constant_16(x) \
((unsigned short int) ((((x) >> 8) & 0xff) | (((x) & 0xff) << 8)))
#endif

#ifndef __bswap_constant_32
#define __bswap_constant_32(x) \
((((x) & 0xff000000) >> 24) | (((x) & 0x00ff0000) >> 8) | \
(((x) & 0x0000ff00) << 8) | (((x) & 0x000000ff) << 24))
#endif

struct client_data {
int fd;
bool debug;
Expand Down

0 comments on commit 9c6c6a4

Please sign in to comment.