]> granicus.if.org Git - postgis/commitdiff
Guard some newer GCC'isms to allow older platforms
authorPaul Ramsey <pramsey@cleverelephant.ca>
Mon, 7 Oct 2019 01:36:19 +0000 (01:36 +0000)
committerPaul Ramsey <pramsey@cleverelephant.ca>
Mon, 7 Oct 2019 01:36:19 +0000 (01:36 +0000)
to still build

git-svn-id: http://svn.osgeo.org/postgis/trunk@17865 b70326c6-7e19-0410-871a-916f4a2858ee

postgis/lwgeom_functions_basic.c
postgis/lwgeom_geos.c
raster/rt_pg/rtpg_mapalgebra.c

index f3947481343e705e181d91602ba8f6a6635cb22f..3bc7d9b49ddb219299b1c581eec5bc88886dd47e 100644 (file)
@@ -1546,10 +1546,14 @@ Datum LWGEOM_makepoly(PG_FUNCTION_ARGS)
                holes = lwalloc(sizeof(LWLINE *) * nholes);
                for (i = 0; i < nholes; i++)
                {
+#if GCC_VERSION >= 40604
 #pragma GCC diagnostic push
 #pragma GCC diagnostic ignored "-Wsign-compare"
+#endif
                        GSERIALIZED *g = (GSERIALIZED *)(ARR_DATA_PTR(array) + offset);
+#if GCC_VERSION >= 40604
 #pragma GCC diagnostic pop
+#endif
                        LWLINE *hole;
                        offset += INTALIGN(VARSIZE(g));
                        if (gserialized_get_type(g) != LINETYPE)
index 8284216254df7e014ce66884ac40b42a34d93c7b..eb4a55442df0b3cd224e36110197aa59e1477333 100644 (file)
@@ -390,10 +390,14 @@ Datum pgis_union_geometry_array(PG_FUNCTION_ARGS)
        /* One geom, good geom? Return it */
        if ( count == 1 && nelems == 1 )
        {
+#if GCC_VERSION >= 40604
 #pragma GCC diagnostic push
 #pragma GCC diagnostic ignored "-Wsign-compare"
+#endif
                PG_RETURN_POINTER((GSERIALIZED *)(ARR_DATA_PTR(array)));
+#if GCC_VERSION >= 40604
 #pragma GCC diagnostic pop
+#endif
        }
 
        /* Ok, we really need GEOS now ;) */
index f447834d9575569dfe5b9ca8a7810a5a18d4838f..7ccb91c4c63ea41a71a9868336ef83bd049fe49b 100644 (file)
@@ -78,8 +78,10 @@ Datum RASTER_mapAlgebra2(PG_FUNCTION_ARGS);
 /* ---------------------------------------------------------------- */
 
 /* Quiet warning */
+#if GCC_VERSION >= 40604
 #pragma GCC diagnostic push
 #pragma GCC diagnostic ignored "-Wunknown-pragmas"
+#endif
 #pragma clang diagnostic push
 #pragma clang diagnostic ignored "-Wgnu-variable-sized-type-not-at-end"
 
@@ -100,7 +102,9 @@ typedef struct {
 } rtpg_nmapalgebra_callback_arg;
 
 #pragma clang diagnostic pop
+#if GCC_VERSION >= 40604
 #pragma GCC diagnostic pop
+#endif
 /* ! Quiet warning */
 
 typedef struct rtpg_nmapalgebra_arg_t *rtpg_nmapalgebra_arg;