The attached patch deletes a few places that attempted to define
INT_MAX, SCHAR_MAX, and the like if they were not previously defined.
All these constants must be defined by limits.h according to C89, so I
think we can safely assume they are provided.
I'll apply this later today, barring any objections.
-Neil
#
# old_revision [c622cca94fea5b603b0581669e65fcb415a9801c]
#
# patch "contrib/dblink/dblink.c"
# from [e8702fb1e2f2f73c553276f55d26eeceb38adb20]
# to [3dbf9fa1ea33efbf8479ae75f5fdca5e40df977b]
#
# patch "src/backend/utils/adt/char.c"
# from [cf1bba62738e5427a8607b803eab730480c705e6]
# to [1e0399546af5332c7cf7e50111070f74baa88147]
#
# patch "src/backend/utils/adt/float.c"
# from [2f0df2760c47e8be1553a16505509e02c01af473]
# to [c5f8a0ea93de8a40f59c08b014919f74820d8188]
#
# patch "src/backend/utils/adt/int.c"
# from [2ffb37a6e73d833f87d841f2ae69fa0a4ce7e9d9]
# to [a6efbb8af0dc5575532c74ad3543ac7e3fd97edc]
#
# patch "src/backend/utils/adt/numutils.c"
# from [d12e2243883ab712cc94fa7027a5cbe071dd38f6]
# to [dc2011cc242dcce86dc1df9140d973a11353150a]
#
============================================================
*** contrib/dblink/dblink.c e8702fb1e2f2f73c553276f55d26eeceb38adb20
--- contrib/dblink/dblink.c 3dbf9fa1ea33efbf8479ae75f5fdca5e40df977b
***************
*** 31,36 ****
--- 31,38 ----
*/
#include "postgres.h"
+ #include <limits.h>
+
#include "libpq-fe.h"
#include "fmgr.h"
#include "funcapi.h"
***************
*** 1112,1120 ****
}
- #ifndef SHRT_MAX
- #define SHRT_MAX (0x7FFF)
- #endif
/*
* dblink_build_sql_insert
*
--- 1114,1119 ----
============================================================
*** src/backend/utils/adt/char.c cf1bba62738e5427a8607b803eab730480c705e6
--- src/backend/utils/adt/char.c 1e0399546af5332c7cf7e50111070f74baa88147
***************
*** 20,33 ****
#include "libpq/pqformat.h"
#include "utils/builtins.h"
- #ifndef SCHAR_MAX
- #define SCHAR_MAX (0x7F)
- #endif
- #ifndef SCHAR_MIN
- #define SCHAR_MIN (-SCHAR_MAX-1)
- #endif
-
-
/*****************************************************************************
* USER I/O ROUTINES *
*****************************************************************************/
--- 20,25 ----
============================================================
*** src/backend/utils/adt/float.c 2f0df2760c47e8be1553a16505509e02c01af473
--- src/backend/utils/adt/float.c c5f8a0ea93de8a40f59c08b014919f74820d8188
***************
*** 74,86 ****
#define M_PI 3.14159265358979323846
#endif
- #ifndef SHRT_MAX
- #define SHRT_MAX 32767
- #endif
- #ifndef SHRT_MIN
- #define SHRT_MIN (-32768)
- #endif
-
/* Recent HPUXen have isfinite() macro in place of more standard finite() */
#if !defined(HAVE_FINITE) && defined(isfinite)
#define finite(x) isfinite(x)
--- 74,79 ----
============================================================
*** src/backend/utils/adt/int.c 2ffb37a6e73d833f87d841f2ae69fa0a4ce7e9d9
--- src/backend/utils/adt/int.c a6efbb8af0dc5575532c74ad3543ac7e3fd97edc
***************
*** 40,52 ****
#include "utils/builtins.h"
- #ifndef SHRT_MAX
- #define SHRT_MAX (0x7FFF)
- #endif
- #ifndef SHRT_MIN
- #define SHRT_MIN (-0x8000)
- #endif
-
#define SAMESIGN(a,b) (((a) < 0) == ((b) < 0))
#define Int2VectorSize(n) (offsetof(int2vector, values) + (n) * sizeof(int2))
--- 40,45 ----
============================================================
*** src/backend/utils/adt/numutils.c d12e2243883ab712cc94fa7027a5cbe071dd38f6
--- src/backend/utils/adt/numutils.c dc2011cc242dcce86dc1df9140d973a11353150a
***************
*** 22,47 ****
#include "utils/builtins.h"
- #ifndef INT_MAX
- #define INT_MAX (0x7FFFFFFFL)
- #endif
- #ifndef INT_MIN
- #define INT_MIN (-INT_MAX-1)
- #endif
- #ifndef SHRT_MAX
- #define SHRT_MAX (0x7FFF)
- #endif
- #ifndef SHRT_MIN
- #define SHRT_MIN (-SHRT_MAX-1)
- #endif
- #ifndef SCHAR_MAX
- #define SCHAR_MAX (0x7F)
- #endif
- #ifndef SCHAR_MIN
- #define SCHAR_MIN (-SCHAR_MAX-1)
- #endif
-
-
/*
* pg_atoi: convert string to integer
*
--- 22,27 ----
---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?
http://www.postgresql.org/docs/faq