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.
This commit is contained in:
Neil Conway 2006-03-11 01:19:22 +00:00
parent c65ab0bfa9
commit 7992d0fbca
5 changed files with 6 additions and 49 deletions

View 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
*

View 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 $
*
*-------------------------------------------------------------------------
*/
@ -20,14 +20,6 @@
#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 *
*****************************************************************************/

View 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 $
*
*-------------------------------------------------------------------------
*/
@ -74,13 +74,6 @@
#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)

View 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 $
*
*-------------------------------------------------------------------------
*/
@ -40,13 +40,6 @@
#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))

View 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 $
*
*-------------------------------------------------------------------------
*/
@ -22,26 +22,6 @@
#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
*