Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 69f2e9b

Browse files
committed
Move slock_t typdefs into s_lock.h from include/port files for
centralization and easier maintanence.
1 parent dcae578 commit 69f2e9b

25 files changed

+158
-382
lines changed

src/backend/port/dynloader/netbsd.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*-
1+
/*
22
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
33
* Portions Copyright (c) 1990 The Regents of the University of California.
44
* All rights reserved.

src/backend/port/dynloader/openbsd.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*-
1+
/*
22
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
33
* Portions Copyright (c) 1990 The Regents of the University of California.
44
* All rights reserved.

src/backend/storage/lmgr/s_lock.c

+4-2
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,14 @@
99
*
1010
*
1111
* IDENTIFICATION
12-
* $PostgreSQL: pgsql/src/backend/storage/lmgr/s_lock.c,v 1.19 2003/12/23 00:32:06 momjian Exp $
12+
* $PostgreSQL: pgsql/src/backend/storage/lmgr/s_lock.c,v 1.20 2003/12/23 03:31:30 momjian Exp $
1313
*
1414
*-------------------------------------------------------------------------
1515
*/
1616
#include "postgres.h"
1717

1818
#include <sys/time.h>
1919
#include <unistd.h>
20-
2120
#include "storage/s_lock.h"
2221

2322

@@ -118,6 +117,9 @@ s_lock(volatile slock_t *lock, const char *file, int line)
118117
* Various TAS implementations that cannot live in s_lock.h as no inline
119118
* definition exists (yet).
120119
* In the future, get rid of tas.[cso] and fold it into this file.
120+
*
121+
* If you change something here, you have to modify s_lock.h because
122+
* the definitions for these is split between this file and s_lock.h.
121123
*/
122124

123125

src/backend/storage/lmgr/spin.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*
1717
*
1818
* IDENTIFICATION
19-
* $PostgreSQL: pgsql/src/backend/storage/lmgr/spin.c,v 1.12 2003/11/29 19:51:57 pgsql Exp $
19+
* $PostgreSQL: pgsql/src/backend/storage/lmgr/spin.c,v 1.13 2003/12/23 03:31:30 momjian Exp $
2020
*
2121
*-------------------------------------------------------------------------
2222
*/
@@ -25,6 +25,7 @@
2525
#include "storage/lwlock.h"
2626
#include "storage/pg_sema.h"
2727
#include "storage/spin.h"
28+
#include "storage/s_lock.h"
2829

2930

3031
#ifdef HAS_TEST_AND_SET

src/include/port/aix.h

-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
#define CLASS_CONFLICT
22
#define DISABLE_XOPEN_NLS
3-
#define HAS_TEST_AND_SET
4-
5-
typedef unsigned int slock_t;
63

74
#include <sys/machine.h> /* ENDIAN definitions for network
85
* communication */

src/include/port/beos.h

-4
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22
#include <kernel/image.h>
33
#include <sys/ioctl.h>
44

5-
#define HAS_TEST_AND_SET
6-
7-
typedef unsigned char slock_t;
8-
95
#define AF_UNIX 10 /* no domain sockets on BeOS */
106

117
/* Beos doesn't have all the required getrusage fields */

src/include/port/bsdi.h

-12
Original file line numberDiff line numberDiff line change
@@ -1,12 +0,0 @@
1-
#if defined(__i386__) || defined(__x86_64__)
2-
typedef unsigned char slock_t;
3-
#endif
4-
#if defined(__ia64)
5-
typedef unsigned int slock_t;
6-
#endif
7-
#if defined(__sparc__)
8-
typedef unsigned char slock_t;
9-
#endif
10-
11-
#define HAS_TEST_AND_SET
12-

src/include/port/cygwin.h

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
/* $PostgreSQL: pgsql/src/include/port/cygwin.h,v 1.5 2003/11/29 19:52:08 pgsql Exp $ */
2-
3-
#define HAS_TEST_AND_SET
4-
typedef unsigned char slock_t;
1+
/* $PostgreSQL: pgsql/src/include/port/cygwin.h,v 1.6 2003/12/23 03:31:30 momjian Exp $ */
52

63
#include <cygwin/version.h>
74

src/include/port/darwin.h

-12
Original file line numberDiff line numberDiff line change
@@ -1,13 +1 @@
11
#define __darwin__ 1
2-
3-
#if defined(__ppc__)
4-
#define HAS_TEST_AND_SET
5-
#endif
6-
7-
#if defined(__ppc__)
8-
typedef unsigned int slock_t;
9-
10-
#else
11-
typedef unsigned char slock_t;
12-
13-
#endif

src/include/port/freebsd.h

-51
Original file line numberDiff line numberDiff line change
@@ -1,51 +0,0 @@
1-
#if defined(__i386__) || defined(__x86_64__)
2-
#define HAS_TEST_AND_SET
3-
typedef unsigned char slock_t;
4-
#endif
5-
6-
#if defined(__ia64)
7-
#define HAS_TEST_AND_SET
8-
typedef unsigned int slock_t;
9-
#endif
10-
11-
#if defined(__sparc__)
12-
#define HAS_TEST_AND_SET
13-
typedef unsigned char slock_t;
14-
#endif
15-
16-
#if defined(__vax__)
17-
#define NEED_VAX_TAS_ASM
18-
#define HAS_TEST_AND_SET
19-
typedef unsigned char slock_t;
20-
#endif
21-
22-
#if defined(__ns32k__)
23-
#define NEED_NS32K_TAS_ASM
24-
#define HAS_TEST_AND_SET
25-
typedef unsigned char slock_t;
26-
#endif
27-
28-
#if defined(__m68k__)
29-
#define HAS_TEST_AND_SET
30-
typedef unsigned char slock_t;
31-
#endif
32-
33-
#if defined(__arm__)
34-
#define HAS_TEST_AND_SET
35-
typedef unsigned char slock_t;
36-
#endif
37-
38-
#if defined(__mips__)
39-
/* # undef HAS_TEST_AND_SET */
40-
#endif
41-
42-
#if defined(__alpha__)
43-
#define HAS_TEST_AND_SET
44-
typedef unsigned long slock_t;
45-
#endif
46-
47-
#if defined(__powerpc__)
48-
#define HAS_TEST_AND_SET
49-
typedef unsigned int slock_t;
50-
51-
#endif

src/include/port/hpux.h

-9
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,12 @@
1010

1111
#if defined(__hppa)
1212

13-
#define HAS_TEST_AND_SET
14-
typedef struct
15-
{
16-
int sema[4];
17-
} slock_t;
18-
1913
#ifndef BYTE_ORDER
2014
#define BYTE_ORDER BIG_ENDIAN
2115
#endif
2216

2317
#elif defined(__ia64)
2418

25-
#define HAS_TEST_AND_SET
26-
typedef unsigned int slock_t;
27-
2819
#ifndef BYTE_ORDER
2920
#define BYTE_ORDER LITTLE_ENDIAN
3021
#endif

src/include/port/irix5.h

-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +0,0 @@
1-
#define HAS_TEST_AND_SET
2-
3-
typedef unsigned long slock_t;

src/include/port/linux.h

-51
Original file line numberDiff line numberDiff line change
@@ -1,51 +0,0 @@
1-
#if defined(__i386__) || defined(__x86_64__)
2-
typedef unsigned char slock_t;
3-
4-
#define HAS_TEST_AND_SET
5-
6-
#elif defined(__sparc__)
7-
typedef unsigned char slock_t;
8-
9-
#define HAS_TEST_AND_SET
10-
11-
#elif defined(__powerpc64__)
12-
typedef unsigned long slock_t;
13-
14-
#define HAS_TEST_AND_SET
15-
16-
#elif defined(__powerpc__)
17-
typedef unsigned int slock_t;
18-
19-
#define HAS_TEST_AND_SET
20-
21-
#elif defined(__alpha__)
22-
typedef long int slock_t;
23-
24-
#define HAS_TEST_AND_SET
25-
26-
#elif defined(__mips__)
27-
typedef unsigned int slock_t;
28-
29-
#define HAS_TEST_AND_SET
30-
31-
#elif defined(__arm__)
32-
typedef unsigned char slock_t;
33-
34-
#define HAS_TEST_AND_SET
35-
36-
#elif defined(__ia64__)
37-
typedef unsigned int slock_t;
38-
39-
#define HAS_TEST_AND_SET
40-
41-
#elif defined(__s390__) || defined(__s390x__)
42-
typedef unsigned int slock_t;
43-
44-
#define HAS_TEST_AND_SET
45-
46-
#elif defined(__mc68000__)
47-
typedef unsigned char slock_t;
48-
49-
#define HAS_TEST_AND_SET
50-
51-
#endif

src/include/port/netbsd.h

-51
Original file line numberDiff line numberDiff line change
@@ -1,51 +0,0 @@
1-
#if defined(__i386__) || defined(__x86_64__)
2-
#define HAS_TEST_AND_SET
3-
typedef unsigned char slock_t;
4-
#endif
5-
6-
#if defined(__ia64)
7-
#define HAS_TEST_AND_SET
8-
typedef unsigned int slock_t;
9-
#endif
10-
11-
#if defined(__sparc__)
12-
#define HAS_TEST_AND_SET
13-
typedef unsigned char slock_t;
14-
#endif
15-
16-
#if defined(__vax__)
17-
#define NEED_VAX_TAS_ASM
18-
#define HAS_TEST_AND_SET
19-
typedef unsigned char slock_t;
20-
#endif
21-
22-
#if defined(__ns32k__)
23-
#define NEED_NS32K_TAS_ASM
24-
#define HAS_TEST_AND_SET
25-
typedef unsigned char slock_t;
26-
#endif
27-
28-
#if defined(__m68k__)
29-
#define HAS_TEST_AND_SET
30-
typedef unsigned char slock_t;
31-
#endif
32-
33-
#if defined(__arm__)
34-
#define HAS_TEST_AND_SET
35-
typedef unsigned char slock_t;
36-
#endif
37-
38-
#if defined(__mips__)
39-
/* # undef HAS_TEST_AND_SET */
40-
#endif
41-
42-
#if defined(__alpha__)
43-
#define HAS_TEST_AND_SET
44-
typedef unsigned long slock_t;
45-
#endif
46-
47-
#if defined(__powerpc__)
48-
#define HAS_TEST_AND_SET
49-
typedef unsigned int slock_t;
50-
51-
#endif

src/include/port/nextstep.h

-1
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,3 @@ typedef int sigset_t;
1515
#endif
1616

1717
#define NO_WAITPID
18-
typedef struct mutex slock_t;

src/include/port/openbsd.h

-51
Original file line numberDiff line numberDiff line change
@@ -1,51 +0,0 @@
1-
#if defined(__i386__) || defined(__x86_64__)
2-
#define HAS_TEST_AND_SET
3-
typedef unsigned char slock_t;
4-
#endif
5-
6-
#if defined(__ia64)
7-
#define HAS_TEST_AND_SET
8-
typedef unsigned int slock_t;
9-
#endif
10-
11-
#if defined(__sparc__)
12-
#define HAS_TEST_AND_SET
13-
typedef unsigned char slock_t;
14-
#endif
15-
16-
#if defined(__vax__)
17-
#define NEED_VAX_TAS_ASM
18-
#define HAS_TEST_AND_SET
19-
typedef unsigned char slock_t;
20-
#endif
21-
22-
#if defined(__ns32k__)
23-
#define NEED_NS32K_TAS_ASM
24-
#define HAS_TEST_AND_SET
25-
typedef unsigned char slock_t;
26-
#endif
27-
28-
#if defined(__m68k__)
29-
#define HAS_TEST_AND_SET
30-
typedef unsigned char slock_t;
31-
#endif
32-
33-
#if defined(__arm__)
34-
#define HAS_TEST_AND_SET
35-
typedef unsigned char slock_t;
36-
#endif
37-
38-
#if defined(__mips__)
39-
/* # undef HAS_TEST_AND_SET */
40-
#endif
41-
42-
#if defined(__alpha__)
43-
#define HAS_TEST_AND_SET
44-
typedef unsigned long slock_t;
45-
#endif
46-
47-
#if defined(__powerpc__)
48-
#define HAS_TEST_AND_SET
49-
typedef unsigned int slock_t;
50-
51-
#endif

src/include/port/osf.h

-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,2 @@
11
#define NOFIXADE
22
#define DISABLE_XOPEN_NLS
3-
#define HAS_TEST_AND_SET
4-
/* #include <sys/mman.h> */ /* for msemaphore */
5-
/*typedef msemaphore slock_t;*/
6-
#include <alpha/builtins.h>
7-
typedef volatile long slock_t;

src/include/port/qnx4.h

-4
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
#include <unix.h>
66
#include <sys/select.h> /* for select */
77

8-
#define HAS_TEST_AND_SET
9-
108
#undef HAVE_GETRUSAGE
119

1210
#define strncasecmp strnicmp
@@ -22,8 +20,6 @@ extern unsigned char __nan[8];
2220

2321
typedef u_short ushort;
2422

25-
typedef unsigned char slock_t;
26-
2723
extern int isnan(double dsrc);
2824

2925
extern long random(void);

src/include/port/sco.h

-9
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,8 @@
11
/* see src/backend/libpq/pqcomm.c */
22
#define SCO_ACCEPT_BUG
33

4-
#define HAS_TEST_AND_SET
5-
64
#define USE_UNIVEL_CC
75

8-
#if defined(__ia64)
9-
typedef unsigned int slock_t;
10-
#else
11-
typedef unsigned char slock_t;
12-
#endif
13-
14-
156
#ifndef BIG_ENDIAN
167
#define BIG_ENDIAN 4321
178
#endif

0 commit comments

Comments
 (0)