From 4c098e4110a51958f694e57748b08bfbab1edbe1 Mon Sep 17 00:00:00 2001 From: Sandro Santilli Date: Fri, 29 Sep 2017 08:20:40 +0000 Subject: [PATCH] Move PostgreSQL conditional at the top of the file This is an attempt to make the code more clear git-svn-id: http://svn.osgeo.org/postgis/trunk@15851 b70326c6-7e19-0410-871a-916f4a2858ee --- postgis/mvt.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/postgis/mvt.c b/postgis/mvt.c index 6dac6f10c..5c7fcb18e 100644 --- a/postgis/mvt.c +++ b/postgis/mvt.c @@ -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 @@ static void parse_values(struct mvt_agg_context *ctx) 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 -- 2.40.0