mirror of
https://github.com/postgres/postgres.git
synced 2025-07-14 08:21:07 +03:00
Clean up INT64CONST conflicts. Make the pg_crc code use a macro called
UINT64CONST, since unsigned was what it wanted anyway. Centralize macro definitions into c.h.
This commit is contained in:
@ -6,7 +6,7 @@
|
||||
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $Id: pg_crc.h,v 1.6 2001/11/05 17:46:36 momjian Exp $
|
||||
* $Id: pg_crc.h,v 1.7 2002/04/23 15:45:30 tgl Exp $
|
||||
*/
|
||||
#ifndef PG_CRC_H
|
||||
#define PG_CRC_H
|
||||
@ -78,23 +78,16 @@ extern const uint32 crc_table1[];
|
||||
|
||||
#else /* int64 works */
|
||||
|
||||
/* decide if we need to decorate constants */
|
||||
#ifdef HAVE_LL_CONSTANTS
|
||||
#define INT64CONST(x) x##LL
|
||||
#else
|
||||
#define INT64CONST(x) x
|
||||
#endif
|
||||
|
||||
typedef struct crc64
|
||||
{
|
||||
uint64 crc0;
|
||||
} crc64;
|
||||
|
||||
/* Initialize a CRC accumulator */
|
||||
#define INIT_CRC64(crc) ((crc).crc0 = INT64CONST(0xffffffffffffffff))
|
||||
#define INIT_CRC64(crc) ((crc).crc0 = UINT64CONST(0xffffffffffffffff))
|
||||
|
||||
/* Finish a CRC calculation */
|
||||
#define FIN_CRC64(crc) ((crc).crc0 ^= INT64CONST(0xffffffffffffffff))
|
||||
#define FIN_CRC64(crc) ((crc).crc0 ^= UINT64CONST(0xffffffffffffffff))
|
||||
|
||||
/* Accumulate some (more) bytes into a CRC */
|
||||
#define COMP_CRC64(crc, data, len) \
|
||||
|
Reference in New Issue
Block a user