[postgis-commits] svn - r2816 - trunk/lwgeom
postgis-commits at postgis.refractions.net
postgis-commits at postgis.refractions.net
Sun Jun 29 12:19:06 PDT 2008
Author: mcayland
Date: 2008-06-29 12:19:06 -0700 (Sun, 29 Jun 2008)
New Revision: 2816
Modified:
trunk/lwgeom/lwgeom_pg.h
trunk/lwgeom/pgsql_compat.h
Log:
Move some PostgreSQL compatibility macros from lwgeom_pg.h into pgsql_compat.h which is their proper home
Modified: trunk/lwgeom/lwgeom_pg.h
===================================================================
--- trunk/lwgeom/lwgeom_pg.h 2008-06-29 19:11:48 UTC (rev 2815)
+++ trunk/lwgeom/lwgeom_pg.h 2008-06-29 19:19:06 UTC (rev 2816)
@@ -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);
Modified: trunk/lwgeom/pgsql_compat.h
===================================================================
--- trunk/lwgeom/pgsql_compat.h 2008-06-29 19:11:48 UTC (rev 2815)
+++ trunk/lwgeom/pgsql_compat.h 2008-06-29 19:19:06 UTC (rev 2816)
@@ -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
More information about the postgis-commits
mailing list