Skip to content

Commit

Permalink
Update shoco.c
Browse files Browse the repository at this point in the history
This is to cope with versions of gcc that do not have the __builtin_bswap32() function defined.
  • Loading branch information
jrichemont committed Jan 9, 2015
1 parent f7adf4d commit 9a30f64
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion shoco.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@
#include <stdlib.h>
#define swap(x) _byteswap_ulong(x)
#elif defined (__GNUC__)
#define swap(x) __builtin_bswap32(x)
#if defined(__builtin_bswap32)
#define swap(x) __builtin_bswap32(x)
#else
#define swap(x) ((x<<24) + ((x&0x0000FF00)<<8) + ((x&0x00FF0000)>>8) + (x>>24))
#endif
#else
#include <byteswap.h>
#define swap(x) bswap_32(x)
Expand Down

0 comments on commit 9a30f64

Please sign in to comment.