[postgis-tickets] r14588 - #3054, build warning on GUC change for PgSQL 9.0
Paul Ramsey
pramsey at cleverelephant.ca
Mon Jan 11 05:53:00 PST 2016
Author: pramsey
Date: 2016-01-11 05:53:00 -0800 (Mon, 11 Jan 2016)
New Revision: 14588
Modified:
branches/2.1/postgis/lwgeom_backend_api.c
Log:
#3054, build warning on GUC change for PgSQL 9.0
Modified: branches/2.1/postgis/lwgeom_backend_api.c
===================================================================
--- branches/2.1/postgis/lwgeom_backend_api.c 2016-01-11 08:58:30 UTC (rev 14587)
+++ branches/2.1/postgis/lwgeom_backend_api.c 2016-01-11 13:53:00 UTC (rev 14588)
@@ -79,21 +79,42 @@
char* lwgeom_backend_name;
struct lwgeom_backend_definition* lwgeom_backend = &lwgeom_backends[0];
+#if POSTGIS_PGSQL_VERSION >= 91
static void lwgeom_backend_switch( const char* newvalue, void* extra )
{
- int i;
+ int i;
- if (!newvalue) { return; }
+ if (!newvalue) { return; }
- for ( i = 0; i < LWGEOM_NUM_BACKENDS; ++i ) {
- if ( !strcmp(lwgeom_backends[i].name, newvalue) ) {
- lwgeom_backend = &lwgeom_backends[i];
- return;
+ for ( i = 0; i < LWGEOM_NUM_BACKENDS; ++i ) {
+ if ( !strcmp(lwgeom_backends[i].name, newvalue) ) {
+ lwgeom_backend = &lwgeom_backends[i];
+ return;
+ }
}
- }
- lwerror("Can't find %s geometry backend", newvalue );
+ lwerror("Can't find %s geometry backend", newvalue );
}
+#else
+static const char * lwgeom_backend_switch( const char* newvalue, bool doit, GucSource source )
+{
+ int i;
+ if (!newvalue)
+ return NULL;
+
+ for (i = 0; i < LWGEOM_NUM_BACKENDS; ++i)
+ {
+ if (!strcmp(lwgeom_backends[i].name, newvalue))
+ {
+ lwgeom_backend = &lwgeom_backends[i];
+ return newvalue;
+ }
+ }
+ lwerror("Can't find %s geometry backend", newvalue );
+ return NULL;
+}
+#endif
+
void lwgeom_init_backend()
{
DefineCustomStringVariable( "postgis.backend", /* name */
More information about the postgis-tickets
mailing list