Skip to content

Commit 7492fb1

Browse files
author
Bryan Henderson
committed
Fix bug: libpq clients (which include libpq-fe.h) won't compile.
Plus: sigjmp_buf/jmp_buf is backwards, so backend doesn't compile.
1 parent 41b3674 commit 7492fb1

File tree

3 files changed

+45
-41
lines changed

3 files changed

+45
-41
lines changed

src/include/config.h

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
#endif
8484

8585
#if defined(hpux)
86-
# define SIGJMP_BUF
86+
# define JMP_BUF
8787
# define USE_POSIX_TIME
8888
# define HAVE_TZSET
8989
# define NEED_CBRT
@@ -129,7 +129,7 @@
129129
__USE_BSD is set by bsd/signal.h, and __USE_BSD_SIGNAL appears not to
130130
be used.
131131
*/
132-
# define SIGJMP_BUF
132+
# define JMP_BUF
133133
# define USE_POSIX_TIME
134134
# define HAVE_TZSET
135135
# define NEED_CBRT
@@ -141,7 +141,7 @@
141141

142142
/* does anybody use this? */
143143
#if defined(next)
144-
# define SIGJMP_BUF
144+
# define JMP_BUF
145145
# define NEED_SIG_JMP
146146
# define SB_PAD 56
147147
typedef struct mutex slock_t;
@@ -184,7 +184,7 @@
184184
#endif
185185

186186
#if defined(win32)
187-
# define SIGJMP_BUF
187+
# define JMP_BUF
188188
# define NEED_SIG_JMP
189189
# define NO_UNISTD_H
190190
# define USES_WINSOCK
@@ -217,20 +217,6 @@
217217
# define SIGNAL_ARGS int postgres_signal_arg
218218
#endif
219219

220-
/* NAMEDATALEN is the max length for system identifiers (e.g. table names,
221-
* attribute names, function names, etc.)
222-
*
223-
* These MUST be set here. DO NOT COMMENT THESE OUT
224-
* Setting these too high will result in excess space usage for system catalogs
225-
* Setting them too low will make the system unusable.
226-
* values between 16 and 64 that are multiples of four are recommended.
227-
*
228-
* NOTE also that databases with different NAMEDATALEN's cannot interoperate!
229-
*/
230-
#define NAMEDATALEN 32
231-
/* OIDNAMELEN should be set to NAMEDATALEN + sizeof(Oid) */
232-
#define OIDNAMELEN 36
233-
234220
/*
235221
* DEF_PGPORT is the TCP port number on which the Postmaster listens by
236222
* default. This can be overriden by command options, environment variables,

src/include/postgres.h

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*
77
* Copyright (c) 1995, Regents of the University of California
88
*
9-
* $Id: postgres.h,v 1.2 1996/11/04 06:35:36 scrappy Exp $
9+
* $Id: postgres.h,v 1.3 1996/12/10 07:03:40 bryanh Exp $
1010
*
1111
*-------------------------------------------------------------------------
1212
*/
@@ -36,6 +36,7 @@
3636
#ifndef POSTGRES_H
3737
#define POSTGRES_H
3838

39+
#include "postgres_ext.h"
3940
#include "config.h"
4041
#include "c.h"
4142
#include "utils/elog.h"
@@ -53,8 +54,6 @@ typedef double float8;
5354

5455
typedef int4 aclitem;
5556

56-
57-
typedef uint32 Oid;
5857
#define InvalidOid 0
5958
#define OidIsValid(objectId) ((bool) (objectId != InvalidOid))
6059

@@ -105,26 +104,6 @@ typedef char16 *Char16;
105104
typedef int2 int28[8];
106105
typedef Oid oid8[8];
107106

108-
/* char16 is distinct from Name.
109-
now, you can truly change the max length of system names
110-
by altering the NAMEDATALEN define below.
111-
don't set the value too high because tuples are still constrained
112-
to be less than 8K
113-
*/
114-
115-
/* NAMEDATALEN is the maximum string length (counting terminating null)
116-
of a Name */
117-
/* defined in Makefile.global */
118-
/* if you change the value of NAMEDATALEN, you may need to change the
119-
alignment of the 'name' type in pg_type.h */
120-
#ifndef NAMEDATALEN
121-
#define NAMEDATALEN 16
122-
#endif /* NAMEDATALEN */
123-
/* OIDNAMELEN should be NAMEDATALEN + sizeof(Oid) */
124-
#ifndef OIDNAMELEN
125-
#define OIDNAMELEN 20
126-
#endif /* OIDNAMELEN */
127-
128107
typedef struct nameData {
129108
char data[NAMEDATALEN];
130109
} NameData;

src/include/postgres_ext.h

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/*-------------------------------------------------------------------------
2+
*
3+
* postgres_ext.h--
4+
*
5+
* This file contains declarations of things that are visible
6+
* external to Postgres. For example, the Oid type is part of a
7+
* structure that is passed to the front end via libpq, and is
8+
* accordingly referenced in libpq-fe.h.
9+
*
10+
* Declarations which are specific to a particular interface should
11+
* go in the header file for that interface (such as libpq-fe.h). This
12+
* file is only for fundamental Postgres declarations.
13+
*
14+
* User-written C functions don't count as "external to Postgres."
15+
* Those function much as local modifications to the backend itself, and
16+
* use header files that are otherwise internal to Postgres to interface
17+
* with the backend.
18+
*
19+
* $Id: postgres_ext.h,v 1.1 1996/12/10 07:03:43 bryanh Exp $
20+
*
21+
*-------------------------------------------------------------------------
22+
*/
23+
24+
#ifndef POSTGRES_EXT_H
25+
#define POSTGRES_EXT_H
26+
27+
typedef unsigned int Oid;
28+
29+
/* NAMEDATALEN is the max length for system identifiers (e.g. table names,
30+
* attribute names, function names, etc.)
31+
*
32+
* NOTE that databases with different NAMEDATALEN's cannot interoperate!
33+
*/
34+
#define NAMEDATALEN 32
35+
36+
/* OIDNAMELEN should be set to NAMEDATALEN + sizeof(Oid) */
37+
#define OIDNAMELEN 36
38+
39+
#endif

0 commit comments

Comments
 (0)