Closed GoogleCodeExporter closed 8 years ago
* Compile-time endianness configuration
Runtime detection is very good. But it would be nice if we could
configure the endianness in compile-time with XXH_CPU_LITTLE_ENDIAN.
The code will look like this:
typedef enum { XXH_bigEndian=0, XXH_littleEndian=1 } XXH_endianess;
+ #ifndef XXH_CPU_LITTLE_ENDIAN
static const int one = 1;
#define XXH_CPU_LITTLE_ENDIAN (*(char*)(&one))
+ #endif
With this change, we can configure the endianness by compiler switch:
gcc -DXXH_CPU_LITTLE_ENDIAN=1 ...
Original comment by takayuki...@gmail.com
on 23 Jul 2013 at 4:27
Thanks Takayuki,
Looks like a simple and great flexibility improvement.
Done.
Original comment by yann.col...@gmail.com
on 23 Jul 2013 at 4:33
Attachments:
included into r31
Original comment by yann.col...@gmail.com
on 25 Jul 2013 at 8:41
Original issue reported on code.google.com by
yann.col...@gmail.com
on 23 Jul 2013 at 9:46Attachments: