Browse Source

Fix crc32 check for little endian systems.

pull/1/head
Daniel Scharrer 14 years ago
parent
commit
065d838ac7
  1. 2
      src/crypto/crc32.cpp
  2. 8
      src/util/endian.hpp

2
src/crypto/crc32.cpp

@ -39,7 +39,7 @@ namespace crypto {
/* Table of CRC-32's of all single byte values (made by makecrc.c) */
const uint32_t crc32::table[] = {
#ifdef BOOST_LITTLE_ENDIAN
#if ENDIANNESS == LITTLE_ENDIAN
0x00000000L, 0x77073096L, 0xee0e612cL, 0x990951baL, 0x076dc419L,
0x706af48fL, 0xe963a535L, 0x9e6495a3L, 0x0edb8832L, 0x79dcb8a4L,
0xe0d5e91eL, 0x97d2d988L, 0x09b64c2bL, 0x7eb17cbdL, 0xe7b82d07L,

8
src/util/endian.hpp

@ -120,11 +120,11 @@ struct endianness<true> {
#define BIG_ENDIAN 4321
#endif
#ifdef HAVE_BIG_ENDIAN
#define ENDIANNESS BIG_ENDIAN
#else
//#ifdef HAVE_BIG_ENDIAN
//#define ENDIANNESS BIG_ENDIAN
//#else
#define ENDIANNESS LITTLE_ENDIAN
#endif
//#endif
struct little_endian : public endianness<ENDIANNESS == LITTLE_ENDIAN> {

Loading…
Cancel
Save