From 5703e75da6797889fe63f2c41b8aea9e363497f6 Mon Sep 17 00:00:00 2001 From: Sandro Santilli Date: Thu, 9 Feb 2012 17:00:23 +0000 Subject: [PATCH] Drop postgis_config.h include from lwgeom_pg.h header. Generally, package config files should _not_ be included by package headers. In this specific case the aim is overriding POSTGIS_DEBUG_LEVEL in implementation files for the sake of enabling debugging of a single file. Also part of this commit is addition of copyright header in two files which were missing it (used git history to figure assignments) git-svn-id: http://svn.osgeo.org/postgis/trunk@9134 b70326c6-7e19-0410-871a-916f4a2858ee --- liblwgeom/lwgeom_transform.c | 1 + libpgcommon/lwgeom_pg.h | 2 -- libpgcommon/lwgeom_transform.c | 1 + postgis/geography_estimate.c | 1 + postgis/geometry_estimate.c | 1 + postgis/long_xact.c | 1 + postgis/lwgeom_accum.c | 2 ++ postgis/lwgeom_box.c | 1 + postgis/lwgeom_box3d.c | 1 + postgis/lwgeom_btree.c | 15 +++++++++++++-- postgis/lwgeom_cache.c | 1 + postgis/lwgeom_dump.c | 18 +++++++++--------- postgis/lwgeom_export.c | 1 + postgis/lwgeom_functions_lrs.c | 5 ++++- postgis/lwgeom_in_geojson.c | 5 ++++- postgis/lwgeom_in_gml.c | 14 +++++++------- postgis/lwgeom_in_kml.c | 8 +++++--- postgis/lwgeom_ogc.c | 2 ++ postgis/lwgeom_rtree.c | 1 + postgis/lwgeom_spheroid.c | 1 + postgis/lwgeom_sqlmm.c | 9 +++++---- postgis/lwgeom_transform.c | 1 + postgis/lwgeom_triggers.c | 14 ++++++++++++++ postgis/postgis_module.c | 2 +- raster/rt_pg/rt_pg.c | 2 ++ 25 files changed, 80 insertions(+), 30 deletions(-) diff --git a/liblwgeom/lwgeom_transform.c b/liblwgeom/lwgeom_transform.c index 76884c466..00853de2a 100644 --- a/liblwgeom/lwgeom_transform.c +++ b/liblwgeom/lwgeom_transform.c @@ -10,6 +10,7 @@ * **********************************************************************/ +#include "../postgis_config.h" #include "liblwgeom.h" #include "lwgeom_log.h" #include diff --git a/libpgcommon/lwgeom_pg.h b/libpgcommon/lwgeom_pg.h index b512ac044..9333a0f00 100644 --- a/libpgcommon/lwgeom_pg.h +++ b/libpgcommon/lwgeom_pg.h @@ -19,8 +19,6 @@ #include "utils/geo_decls.h" #include "fmgr.h" -#include "../postgis_config.h" - #include "liblwgeom.h" #include "pgsql_compat.h" diff --git a/libpgcommon/lwgeom_transform.c b/libpgcommon/lwgeom_transform.c index cb7545a29..07bba1811 100644 --- a/libpgcommon/lwgeom_transform.c +++ b/libpgcommon/lwgeom_transform.c @@ -21,6 +21,7 @@ #include "utils/hsearch.h" /* PostGIS headers */ +#include "../postgis_config.h" #include "liblwgeom.h" #include "lwgeom_pg.h" #include "lwgeom_transform.h" diff --git a/postgis/geography_estimate.c b/postgis/geography_estimate.c index 9f8c91296..6e7854bed 100644 --- a/postgis/geography_estimate.c +++ b/postgis/geography_estimate.c @@ -19,6 +19,7 @@ #include "utils/lsyscache.h" #include "utils/syscache.h" +#include "../postgis_config.h" #include "liblwgeom.h" #include "lwgeom_pg.h" diff --git a/postgis/geometry_estimate.c b/postgis/geometry_estimate.c index 5f568ffce..489c70ae0 100644 --- a/postgis/geometry_estimate.c +++ b/postgis/geometry_estimate.c @@ -22,6 +22,7 @@ #include "utils/lsyscache.h" #include "utils/syscache.h" +#include "../postgis_config.h" #include "liblwgeom.h" #include "lwgeom_pg.h" /* For debugging macros. */ #include "gserialized_gist.h" /* For index common functions */ diff --git a/postgis/long_xact.c b/postgis/long_xact.c index ef1666de8..afaf042dd 100644 --- a/postgis/long_xact.c +++ b/postgis/long_xact.c @@ -16,6 +16,7 @@ #include "commands/trigger.h" /* ... and triggers */ #include "utils/lsyscache.h" /* for get_namespace_name() */ +#include "../postgis_config.h" #include "lwgeom_pg.h" #define ABORT_ON_AUTH_FAILURE 1 diff --git a/postgis/lwgeom_accum.c b/postgis/lwgeom_accum.c index b5f6b1c2f..943e4eb4b 100644 --- a/postgis/lwgeom_accum.c +++ b/postgis/lwgeom_accum.c @@ -17,6 +17,8 @@ #include "utils/array.h" #include "utils/lsyscache.h" +#include "../postgis_config.h" + #include "liblwgeom.h" #include "lwgeom_pg.h" diff --git a/postgis/lwgeom_box.c b/postgis/lwgeom_box.c index 650057f5a..cf3063fdd 100644 --- a/postgis/lwgeom_box.c +++ b/postgis/lwgeom_box.c @@ -18,6 +18,7 @@ #include "utils/elog.h" #include "utils/geo_decls.h" +#include "../postgis_config.h" #include "lwgeom_pg.h" #include "liblwgeom.h" #include "liblwgeom_internal.h" diff --git a/postgis/lwgeom_box3d.c b/postgis/lwgeom_box3d.c index 2c3fcfafb..73e9a9807 100644 --- a/postgis/lwgeom_box3d.c +++ b/postgis/lwgeom_box3d.c @@ -9,6 +9,7 @@ #include "utils/elog.h" #include "utils/geo_decls.h" +#include "../postgis_config.h" #include "lwgeom_pg.h" #include "liblwgeom.h" #include "liblwgeom_internal.h" diff --git a/postgis/lwgeom_btree.c b/postgis/lwgeom_btree.c index d2994827b..12bc1162c 100644 --- a/postgis/lwgeom_btree.c +++ b/postgis/lwgeom_btree.c @@ -1,6 +1,16 @@ -/*********************************************************** +/********************************************************************** * - * $Id$ + * PostGIS - Spatial Types for PostgreSQL + * http://postgis.refractions.net + * + * Copyright (C) 2010 Olivier Courtin + * Copyright (C) 2010 Mark Cave-Ayland + * Copyright (C) 2009-2011 Paul Ramsey + * + * This is free software; you can redistribute and/or modify it under + * the terms of the GNU General Public Licence. See the COPYING file. + * + ********************************************************************** * * Comparision function for use in Binary Tree searches * (ORDER BY, GROUP BY, DISTINCT) @@ -11,6 +21,7 @@ #include "fmgr.h" #include "utils/geo_decls.h" +#include "../postgis_config.h" #include "liblwgeom.h" #include "lwgeom_pg.h" diff --git a/postgis/lwgeom_cache.c b/postgis/lwgeom_cache.c index 400ad314f..7f470fc6b 100644 --- a/postgis/lwgeom_cache.c +++ b/postgis/lwgeom_cache.c @@ -13,6 +13,7 @@ #include "postgres.h" #include "fmgr.h" +#include "../postgis_config.h" #include "lwgeom_cache.h" GeomCache* GetGeomCache(FunctionCallInfoData *fcinfo) diff --git a/postgis/lwgeom_dump.c b/postgis/lwgeom_dump.c index a84b74dd4..9af164a68 100644 --- a/postgis/lwgeom_dump.c +++ b/postgis/lwgeom_dump.c @@ -9,6 +9,14 @@ * the terms of the GNU General Public Licence. See the COPYING file. * **********************************************************************/ + +#include +#include +#include +#include +#include +#include + #include "postgres.h" #include "fmgr.h" #include "utils/elog.h" @@ -16,18 +24,10 @@ #include "utils/geo_decls.h" #include "funcapi.h" +#include "../postgis_config.h" #include "liblwgeom.h" #include "lwgeom_pg.h" -#include "../postgis_config.h" - -#include -#include -#include -#include -#include -#include - Datum LWGEOM_dump(PG_FUNCTION_ARGS); Datum LWGEOM_dump_rings(PG_FUNCTION_ARGS); diff --git a/postgis/lwgeom_export.c b/postgis/lwgeom_export.c index f64f0c83e..c95c0feb3 100644 --- a/postgis/lwgeom_export.c +++ b/postgis/lwgeom_export.c @@ -17,6 +17,7 @@ #include "postgres.h" #include "executor/spi.h" +#include "../postgis_config.h" #include "lwgeom_pg.h" #include "liblwgeom.h" #include "lwgeom_export.h" diff --git a/postgis/lwgeom_functions_lrs.c b/postgis/lwgeom_functions_lrs.c index 774907641..5736bd553 100644 --- a/postgis/lwgeom_functions_lrs.c +++ b/postgis/lwgeom_functions_lrs.c @@ -10,11 +10,14 @@ * **********************************************************************/ +#include + #include "postgres.h" #include "fmgr.h" + +#include "../postgis_config.h" #include "liblwgeom.h" #include "lwgeom_pg.h" -#include "math.h" /* * Add a measure dimension to a line, interpolating linearly from the diff --git a/postgis/lwgeom_in_geojson.c b/postgis/lwgeom_in_geojson.c index bb6cce151..b2bd76d78 100644 --- a/postgis/lwgeom_in_geojson.c +++ b/postgis/lwgeom_in_geojson.c @@ -8,10 +8,13 @@ * **********************************************************************/ +#include + #include "postgres.h" + +#include "../postgis_config.h" #include "lwgeom_pg.h" #include "liblwgeom.h" -#include Datum geom_from_geojson(PG_FUNCTION_ARGS); diff --git a/postgis/lwgeom_in_gml.c b/postgis/lwgeom_in_gml.c index 3c6fc9c61..4bb69d9b3 100644 --- a/postgis/lwgeom_in_gml.c +++ b/postgis/lwgeom_in_gml.c @@ -34,18 +34,18 @@ **********************************************************************/ -#include "postgres.h" -#include "lwgeom_pg.h" -#include "liblwgeom.h" -#include "lwgeom_transform.h" -#include "executor/spi.h" - - #include #include #include #include +#include "postgres.h" +#include "executor/spi.h" + +#include "../postgis_config.h" +#include "lwgeom_pg.h" +#include "liblwgeom.h" +#include "lwgeom_transform.h" Datum geom_from_gml(PG_FUNCTION_ARGS); diff --git a/postgis/lwgeom_in_kml.c b/postgis/lwgeom_in_kml.c index 50fa92948..6b01f2153 100644 --- a/postgis/lwgeom_in_kml.c +++ b/postgis/lwgeom_in_kml.c @@ -27,14 +27,16 @@ **********************************************************************/ +#include +#include + #include "postgres.h" + +#include "../postgis_config.h" #include "lwgeom_pg.h" #include "liblwgeom.h" -#include -#include - /* TODO: diff --git a/postgis/lwgeom_ogc.c b/postgis/lwgeom_ogc.c index 3a9219d0a..0e3641991 100644 --- a/postgis/lwgeom_ogc.c +++ b/postgis/lwgeom_ogc.c @@ -24,6 +24,8 @@ #include "fmgr.h" #include "utils/elog.h" +#include "../postgis_config.h" + #include "liblwgeom.h" #include "lwgeom_pg.h" diff --git a/postgis/lwgeom_rtree.c b/postgis/lwgeom_rtree.c index dff6810cb..259962642 100644 --- a/postgis/lwgeom_rtree.c +++ b/postgis/lwgeom_rtree.c @@ -11,6 +11,7 @@ #include +#include "../postgis_config.h" #include "lwgeom_pg.h" #include "liblwgeom.h" #include "liblwgeom_internal.h" /* For FP comparators. */ diff --git a/postgis/lwgeom_spheroid.c b/postgis/lwgeom_spheroid.c index ddbc7cb14..453cafd25 100644 --- a/postgis/lwgeom_spheroid.c +++ b/postgis/lwgeom_spheroid.c @@ -25,6 +25,7 @@ #include "fmgr.h" #include "utils/elog.h" +#include "../postgis_config.h" #include "liblwgeom.h" #include "lwgeom_pg.h" diff --git a/postgis/lwgeom_sqlmm.c b/postgis/lwgeom_sqlmm.c index c3da5c64e..37ec9f0ac 100644 --- a/postgis/lwgeom_sqlmm.c +++ b/postgis/lwgeom_sqlmm.c @@ -10,16 +10,17 @@ * **********************************************************************/ -#include "postgres.h" -#include "liblwgeom.h" -#include "fmgr.h" - #include #include #include #include #include +#include "postgres.h" +#include "fmgr.h" + +#include "../postgis_config.h" +#include "liblwgeom.h" #include "lwgeom_pg.h" diff --git a/postgis/lwgeom_transform.c b/postgis/lwgeom_transform.c index a006fdad0..a9abd1fbc 100644 --- a/postgis/lwgeom_transform.c +++ b/postgis/lwgeom_transform.c @@ -13,6 +13,7 @@ #include "postgres.h" #include "fmgr.h" +#include "../postgis_config.h" #include "liblwgeom.h" #include "lwgeom_transform.h" diff --git a/postgis/lwgeom_triggers.c b/postgis/lwgeom_triggers.c index 294b89b55..9f62afcb4 100644 --- a/postgis/lwgeom_triggers.c +++ b/postgis/lwgeom_triggers.c @@ -1,6 +1,20 @@ +/********************************************************************** + * + * PostGIS - Spatial Types for PostgreSQL + * http://postgis.refractions.net + * + * Copyright (C) 2004 Refractions Research Inc. + * + * This is free software; you can redistribute and/or modify it under + * the terms of the GNU General Public Licence. See the COPYING file. + * + **********************************************************************/ + #include "postgres.h" #include "executor/spi.h" /* this is what you need to work with SPI */ #include "commands/trigger.h" /* ... and triggers */ + +#include "../postgis_config.h" #include "lwgeom_pg.h" Datum cache_bbox(PG_FUNCTION_ARGS); diff --git a/postgis/postgis_module.c b/postgis/postgis_module.c index 654b84b36..045386e94 100644 --- a/postgis/postgis_module.c +++ b/postgis/postgis_module.c @@ -15,9 +15,9 @@ #include "utils/elog.h" #include "utils/guc.h" +#include "../postgis_config.h" #include "lwgeom_log.h" #include "lwgeom_pg.h" -#include "../postgis_config.h" /* * This is required for builds against pgsql diff --git a/raster/rt_pg/rt_pg.c b/raster/rt_pg/rt_pg.c index 9a35386ff..a5ee09f4d 100644 --- a/raster/rt_pg/rt_pg.c +++ b/raster/rt_pg/rt_pg.c @@ -46,6 +46,8 @@ #include /* for GetAttributeByName in RASTER_reclass */ #include +#include "../../postgis_config.h" + #include "lwgeom_pg.h" #include "liblwgeom.h" #include "liblwgeom_internal.h" /* for clamp_srid() */ -- 2.40.0