Skip to content

Commit

Permalink
- Fixed xlogdump not to use pg_crc32_table when building against 9.2,
Browse files Browse the repository at this point in the history
  because 9.2 has the CRC table as a header file, pg_crc_tables.h.

  Own CRC table is only needed when building xlogdump against 9.1
  or older versions.
  • Loading branch information
snaga committed Nov 17, 2012
1 parent 0e4e1a4 commit e9f6442
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
3 changes: 1 addition & 2 deletions Makefile
@@ -1,8 +1,7 @@
PROGRAM = xlogdump
OBJS = strlcpy.o xlogdump.o xlogdump_rmgr.o xlogdump_statement.o xlogdump_oid2name.o
OBJS += pg_crc32_table.o

PG_CPPFLAGS = -I$(libpq_srcdir) -DDATADIR=\"$(datadir)\"
PG_CPPFLAGS = -I. -I$(libpq_srcdir) -DDATADIR=\"$(datadir)\"
PG_LIBS = $(libpq_pgport)

DATA = oid2name.txt
Expand Down
5 changes: 5 additions & 0 deletions pg_crc32_table.c → pg_crc32_table.h
@@ -1,3 +1,6 @@
#ifndef __PG_CRC32_TABLE__
#define __PG_CRC32_TABLE__

#include "postgres.h"

const uint32 pg_crc32_table[256] = {
Expand Down Expand Up @@ -66,3 +69,5 @@ const uint32 pg_crc32_table[256] = {
0xB3667A2E, 0xC4614AB8, 0x5D681B02, 0x2A6F2B94,
0xB40BBE37, 0xC30C8EA1, 0x5A05DF1B, 0x2D02EF8D
};

#endif /* __PG_CRC32_TABLE__ */
6 changes: 6 additions & 0 deletions xlogdump.c
Expand Up @@ -40,6 +40,12 @@
#include "catalog/pg_control.h"
#include "utils/pg_crc.h"

#if PG_VERSION_NUM >= 90200
#include "utils/pg_crc_tables.h"
#else
#include "pg_crc32_table.h"
#endif

#include "libpq-fe.h"
#include "pg_config.h"
#include "pqexpbuffer.h"
Expand Down

0 comments on commit e9f6442

Please sign in to comment.