1 ///////////////////////////////////////////////////////////////////////////////
4 /// \brief Some endian-dependent macros for CRC32 and CRC64
6 // This code has been put into the public domain.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12 ///////////////////////////////////////////////////////////////////////////////
14 #ifdef WORDS_BIGENDIAN
15 # include "../../common/bswap.h"
17 # define A(x) ((x) >> 24)
18 # define B(x) (((x) >> 16) & 0xFF)
19 # define C(x) (((x) >> 8) & 0xFF)
20 # define D(x) ((x) & 0xFF)
22 # define S8(x) ((x) << 8)
23 # define S32(x) ((x) << 32)
26 # define A(x) ((x) & 0xFF)
27 # define B(x) (((x) >> 8) & 0xFF)
28 # define C(x) (((x) >> 16) & 0xFF)
29 # define D(x) ((x) >> 24)
31 # define S8(x) ((x) >> 8)
32 # define S32(x) ((x) >> 32)