[postgis-tickets] r15851 - Move PostgreSQL conditional at the top of the file

Sandro Santilli strk at kbt.io
Fri Sep 29 01:20:40 PDT 2017


Author: strk
Date: 2017-09-29 01:20:40 -0700 (Fri, 29 Sep 2017)
New Revision: 15851

Modified:
   trunk/postgis/mvt.c
Log:
Move PostgreSQL conditional at the top of the file

This is an attempt to make the code more clear

Modified: trunk/postgis/mvt.c
===================================================================
--- trunk/postgis/mvt.c	2017-09-29 04:43:40 UTC (rev 15850)
+++ trunk/postgis/mvt.c	2017-09-29 08:20:40 UTC (rev 15851)
@@ -30,6 +30,11 @@
 #include "utils/jsonb.h"
 #endif
 
+#if POSTGIS_PGSQL_VERSION < 110
+/* See trac ticket #3867 */
+# define DatumGetJsonbP DatumGetJsonb
+#endif
+
 #include "uthash.h"
 
 #define FEATURES_CAPACITY_INITIAL 50
@@ -587,11 +592,7 @@
 		if (k == -1 && typoid != JSONBOID)
 			elog(ERROR, "parse_values: unexpectedly could not find parsed key name '%s'", key);
 		if (typoid == JSONBOID) {
-#if POSTGIS_PGSQL_VERSION < 110
-			tags = parse_jsonb(ctx, DatumGetJsonb(datum), tags);
-#else
 			tags = parse_jsonb(ctx, DatumGetJsonbP(datum), tags);
-#endif
 			continue;
 		}
 #else



More information about the postgis-tickets mailing list