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

Commit 7992d0f

Browse files
author
Neil Conway
committed
Remove a few places that attempted to define INT_MAX, SCHAR_MAX, and
similar constants if they were not previously defined. All these constants must be defined by limits.h according to C89, so we can safely assume they are present.
1 parent c65ab0b commit 7992d0f

File tree

5 files changed

+6
-49
lines changed

5 files changed

+6
-49
lines changed

contrib/dblink/dblink.c

+2-3
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131
*/
3232
#include "postgres.h"
3333

34+
#include <limits.h>
35+
3436
#include "libpq-fe.h"
3537
#include "fmgr.h"
3638
#include "funcapi.h"
@@ -1112,9 +1114,6 @@ dblink_get_pkey(PG_FUNCTION_ARGS)
11121114
}
11131115

11141116

1115-
#ifndef SHRT_MAX
1116-
#define SHRT_MAX (0x7FFF)
1117-
#endif
11181117
/*
11191118
* dblink_build_sql_insert
11201119
*

src/backend/utils/adt/char.c

+1-9
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
*
1010
*
1111
* IDENTIFICATION
12-
* $PostgreSQL: pgsql/src/backend/utils/adt/char.c,v 1.44 2006/03/05 15:58:41 momjian Exp $
12+
* $PostgreSQL: pgsql/src/backend/utils/adt/char.c,v 1.45 2006/03/11 01:19:22 neilc Exp $
1313
*
1414
*-------------------------------------------------------------------------
1515
*/
@@ -20,14 +20,6 @@
2020
#include "libpq/pqformat.h"
2121
#include "utils/builtins.h"
2222

23-
#ifndef SCHAR_MAX
24-
#define SCHAR_MAX (0x7F)
25-
#endif
26-
#ifndef SCHAR_MIN
27-
#define SCHAR_MIN (-SCHAR_MAX-1)
28-
#endif
29-
30-
3123
/*****************************************************************************
3224
* USER I/O ROUTINES *
3325
*****************************************************************************/

src/backend/utils/adt/float.c

+1-8
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/utils/adt/float.c,v 1.122 2006/03/10 20:15:25 neilc Exp $
11+
* $PostgreSQL: pgsql/src/backend/utils/adt/float.c,v 1.123 2006/03/11 01:19:22 neilc Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -74,13 +74,6 @@
7474
#define M_PI 3.14159265358979323846
7575
#endif
7676

77-
#ifndef SHRT_MAX
78-
#define SHRT_MAX 32767
79-
#endif
80-
#ifndef SHRT_MIN
81-
#define SHRT_MIN (-32768)
82-
#endif
83-
8477
/* Recent HPUXen have isfinite() macro in place of more standard finite() */
8578
#if !defined(HAVE_FINITE) && defined(isfinite)
8679
#define finite(x) isfinite(x)

src/backend/utils/adt/int.c

+1-8
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/utils/adt/int.c,v 1.71 2006/03/05 15:58:42 momjian Exp $
11+
* $PostgreSQL: pgsql/src/backend/utils/adt/int.c,v 1.72 2006/03/11 01:19:22 neilc Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -40,13 +40,6 @@
4040
#include "utils/builtins.h"
4141

4242

43-
#ifndef SHRT_MAX
44-
#define SHRT_MAX (0x7FFF)
45-
#endif
46-
#ifndef SHRT_MIN
47-
#define SHRT_MIN (-0x8000)
48-
#endif
49-
5043
#define SAMESIGN(a,b) (((a) < 0) == ((b) < 0))
5144

5245
#define Int2VectorSize(n) (offsetof(int2vector, values) + (n) * sizeof(int2))

src/backend/utils/adt/numutils.c

+1-21
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*
1111
*
1212
* IDENTIFICATION
13-
* $PostgreSQL: pgsql/src/backend/utils/adt/numutils.c,v 1.73 2006/03/05 15:58:43 momjian Exp $
13+
* $PostgreSQL: pgsql/src/backend/utils/adt/numutils.c,v 1.74 2006/03/11 01:19:22 neilc Exp $
1414
*
1515
*-------------------------------------------------------------------------
1616
*/
@@ -22,26 +22,6 @@
2222

2323
#include "utils/builtins.h"
2424

25-
#ifndef INT_MAX
26-
#define INT_MAX (0x7FFFFFFFL)
27-
#endif
28-
#ifndef INT_MIN
29-
#define INT_MIN (-INT_MAX-1)
30-
#endif
31-
#ifndef SHRT_MAX
32-
#define SHRT_MAX (0x7FFF)
33-
#endif
34-
#ifndef SHRT_MIN
35-
#define SHRT_MIN (-SHRT_MAX-1)
36-
#endif
37-
#ifndef SCHAR_MAX
38-
#define SCHAR_MAX (0x7F)
39-
#endif
40-
#ifndef SCHAR_MIN
41-
#define SCHAR_MIN (-SCHAR_MAX-1)
42-
#endif
43-
44-
4525
/*
4626
* pg_atoi: convert string to integer
4727
*

0 commit comments

Comments
 (0)