46#define INIT_TRADITIONAL_CRC32(crc) ((crc) = 0xFFFFFFFF)
47#define FIN_TRADITIONAL_CRC32(crc) ((crc) ^= 0xFFFFFFFF)
48#define COMP_TRADITIONAL_CRC32(crc, data, len) \
49 COMP_CRC32_NORMAL_TABLE(crc, data, len, pg_crc32_table)
50#define EQ_TRADITIONAL_CRC32(c1, c2) ((c1) == (c2))
53#define COMP_CRC32_NORMAL_TABLE(crc, data, len, table) \
55 const unsigned char *__data = (const unsigned char *) (data); \
56 uint32 __len = (len); \
60 int __tab_index = ((int) (crc) ^ *__data++) & 0xFF; \
61 (crc) = table[__tab_index] ^ ((crc) >> 8); \
79#define INIT_LEGACY_CRC32(crc) ((crc) = 0xFFFFFFFF)
80#define FIN_LEGACY_CRC32(crc) ((crc) ^= 0xFFFFFFFF)
81#define COMP_LEGACY_CRC32(crc, data, len) \
82 COMP_CRC32_REFLECTED_TABLE(crc, data, len, pg_crc32_table)
83#define EQ_LEGACY_CRC32(c1, c2) ((c1) == (c2))
89#define COMP_CRC32_REFLECTED_TABLE(crc, data, len, table) \
91 const unsigned char *__data = (const unsigned char *) (data); \
92 uint32 __len = (len); \
96 int __tab_index = ((int) ((crc) >> 24) ^ *__data++) & 0xFF; \
97 (crc) = table[__tab_index] ^ ((crc) << 8); \
PGDLLIMPORT const uint32 pg_crc32_table[256]