Move some PostgreSQL compatibility macros from lwgeom_pg.h into pgsql_compat.h which is their proper home

git-svn-id: http://svn.osgeo.org/postgis/trunk@2816 b70326c6-7e19-0410-871a-916f4a2858ee
This commit is contained in:
Mark Cave-Ayland 2008-06-29 19:19:06 +00:00
parent ffde636dc0
commit 2a63450b84
2 changed files with 10 additions and 8 deletions

View file

@ -8,14 +8,6 @@
#include "liblwgeom.h"
#include "pgsql_compat.h"
#ifndef PG_NARGS
#define PG_NARGS() (fcinfo->nargs)
#endif
#if POSTGIS_PGSQL_VERSION < 82
#define ARR_OVERHEAD_NONULLS(x) ARR_OVERHEAD((x))
#endif
void *pg_alloc(size_t size);
void *pg_realloc(void *ptr, size_t size);
void pg_free(void *ptr);

View file

@ -1,5 +1,15 @@
#ifndef _PGSQL_COMPAT_H
/* Make sure PG_NARGS is defined for older PostgreSQL versions */
#ifndef PG_NARGS
#define PG_NARGS() (fcinfo->nargs)
#endif
/* Define ARR_OVERHEAD_NONULLS for PostgreSQL < 8.2 */
#if POSTGIS_PGSQL_VERSION < 82
#define ARR_OVERHEAD_NONULLS(x) ARR_OVERHEAD((x))
#endif
/* PostgreSQL < 8.3 uses VARATT_SIZEP rather than SET_VARSIZE for varlena types */
#if POSTGIS_PGSQL_VERSION < 83
#define SET_VARSIZE(var, size) VARATT_SIZEP(var) = size