]> granicus.if.org Git - postgresql/commitdiff
Remove a few places that attempted to define INT_MAX, SCHAR_MAX, and
authorNeil Conway <neilc@samurai.com>
Sat, 11 Mar 2006 01:19:22 +0000 (01:19 +0000)
committerNeil Conway <neilc@samurai.com>
Sat, 11 Mar 2006 01:19:22 +0000 (01:19 +0000)
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.

contrib/dblink/dblink.c
src/backend/utils/adt/char.c
src/backend/utils/adt/float.c
src/backend/utils/adt/int.c
src/backend/utils/adt/numutils.c

index b1b863ea1e45a4cac3aa5ef5f6b7a0d4c3dcfd47..22a3425ee7e003ce8461e7c40c702648cbf2584b 100644 (file)
@@ -31,6 +31,8 @@
  */
 #include "postgres.h"
 
+#include <limits.h>
+
 #include "libpq-fe.h"
 #include "fmgr.h"
 #include "funcapi.h"
@@ -1112,9 +1114,6 @@ dblink_get_pkey(PG_FUNCTION_ARGS)
 }
 
 
-#ifndef SHRT_MAX
-#define SHRT_MAX (0x7FFF)
-#endif
 /*
  * dblink_build_sql_insert
  *
index 4390e838a5912b93863f82aec0831bf964ab4ef9..db91bf18178a2c9a5a7e43dcb9cb979468df2d63 100644 (file)
@@ -9,7 +9,7 @@
  *
  *
  * IDENTIFICATION
- *       $PostgreSQL: pgsql/src/backend/utils/adt/char.c,v 1.44 2006/03/05 15:58:41 momjian Exp $
+ *       $PostgreSQL: pgsql/src/backend/utils/adt/char.c,v 1.45 2006/03/11 01:19:22 neilc Exp $
  *
  *-------------------------------------------------------------------------
  */
 #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                                                                                                               *
  *****************************************************************************/
index 29a2124e5f3dc064aaea5e50485a00a4dfcda70a..3382b86ba0dcb2a33397856e0ef573057c4b5d29 100644 (file)
@@ -8,7 +8,7 @@
  *
  *
  * IDENTIFICATION
- *       $PostgreSQL: pgsql/src/backend/utils/adt/float.c,v 1.122 2006/03/10 20:15:25 neilc Exp $
+ *       $PostgreSQL: pgsql/src/backend/utils/adt/float.c,v 1.123 2006/03/11 01:19:22 neilc Exp $
  *
  *-------------------------------------------------------------------------
  */
 #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)
index 61e06ff8847ff526d879740e9b148d45f07c1134..de59276ecb1b0d62cae3647c5e76c23f433befff 100644 (file)
@@ -8,7 +8,7 @@
  *
  *
  * IDENTIFICATION
- *       $PostgreSQL: pgsql/src/backend/utils/adt/int.c,v 1.71 2006/03/05 15:58:42 momjian Exp $
+ *       $PostgreSQL: pgsql/src/backend/utils/adt/int.c,v 1.72 2006/03/11 01:19:22 neilc Exp $
  *
  *-------------------------------------------------------------------------
  */
 #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))
index ab06b7697456151c2ad10c739a3d1b8776fba0af..0317e63d08ee06107d582c8aa10b5b741d9224af 100644 (file)
@@ -10,7 +10,7 @@
  *
  *
  * IDENTIFICATION
- *       $PostgreSQL: pgsql/src/backend/utils/adt/numutils.c,v 1.73 2006/03/05 15:58:43 momjian Exp $
+ *       $PostgreSQL: pgsql/src/backend/utils/adt/numutils.c,v 1.74 2006/03/11 01:19:22 neilc Exp $
  *
  *-------------------------------------------------------------------------
  */
 
 #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
  *