From 175475278c712e0c297dc8c04c5e7d32d23865ab Mon Sep 17 00:00:00 2001 From: Thomas Bonfort Date: Thu, 9 Jul 2015 15:13:42 +0200 Subject: [PATCH] Avoid including header files inside an extern C block (#5117) --- mapcontext.c | 2 +- mapdraw.c | 1 + mapgml.c | 1 + mapkmlrenderer.cpp | 1 + mapobject.c | 1 + mapogcfilter.c | 1 + mapogcsld.c | 1 + mapogcsos.c | 1 + mapogr.cpp | 1 + mapogroutput.c | 1 + mapows.c | 1 + mapows.h | 13 ++++++++++++- mapserver.h | 6 ------ mapwcs.c | 1 + mapwcs11.c | 1 + mapwcs20.c | 1 + mapwfs.c | 1 + mapwms.c | 1 + mapwmslayer.c | 1 + 19 files changed, 29 insertions(+), 8 deletions(-) diff --git a/mapcontext.c b/mapcontext.c index 1b71216d7f..db9150cb4a 100644 --- a/mapcontext.c +++ b/mapcontext.c @@ -27,7 +27,7 @@ ****************************************************************************/ #include "mapserver.h" - +#include "mapows.h" #if defined(USE_WMS_LYR) && defined(USE_OGR) diff --git a/mapdraw.c b/mapdraw.c index 1221b90573..1a7a73a3c3 100644 --- a/mapdraw.c +++ b/mapdraw.c @@ -33,6 +33,7 @@ #include "maptime.h" #include "mapcopy.h" #include "mapfile.h" +#include "mapows.h" /* msPrepareImage() diff --git a/mapgml.c b/mapgml.c index 3e07119a4b..52a6587411 100644 --- a/mapgml.c +++ b/mapgml.c @@ -29,6 +29,7 @@ #include "mapserver.h" #include "maperror.h" +#include "mapows.h" #include "mapgml.h" #include "maptime.h" diff --git a/mapkmlrenderer.cpp b/mapkmlrenderer.cpp index f65fb45a1e..7829eb221b 100644 --- a/mapkmlrenderer.cpp +++ b/mapkmlrenderer.cpp @@ -34,6 +34,7 @@ #include "maperror.h" #include "mapkmlrenderer.h" #include "mapio.h" +#include "mapows.h" #if defined(USE_OGR) # include "cpl_conv.h" diff --git a/mapobject.c b/mapobject.c index 255b47cc52..8c5cdb5ab9 100644 --- a/mapobject.c +++ b/mapobject.c @@ -29,6 +29,7 @@ ****************************************************************************/ #include "mapserver.h" +#include "mapows.h" #ifdef USE_GDAL # include "gdal.h" diff --git a/mapogcfilter.c b/mapogcfilter.c index 3d4bab8b68..50e73815dd 100644 --- a/mapogcfilter.c +++ b/mapogcfilter.c @@ -39,6 +39,7 @@ #include "mapserver.h" #include "mapowscommon.h" #include "maptime.h" +#include "mapows.h" static int FLTHasUniqueTopLevelDuringFilter(FilterEncodingNode *psFilterNode); diff --git a/mapogcsld.c b/mapogcsld.c index af0cb76bea..b3372ff91a 100644 --- a/mapogcsld.c +++ b/mapogcsld.c @@ -29,6 +29,7 @@ #include "mapogcsld.h" #include "mapogcfilter.h" #include "mapserver.h" +#include "mapows.h" #ifdef USE_OGR #include "cpl_string.h" diff --git a/mapogcsos.c b/mapogcsos.c index df0926141b..f709c4882f 100644 --- a/mapogcsos.c +++ b/mapogcsos.c @@ -30,6 +30,7 @@ #define _GNU_SOURCE #include "mapserver.h" +#include "mapows.h" #if defined(USE_SOS_SVR) && defined(USE_LIBXML2) diff --git a/mapogr.cpp b/mapogr.cpp index 1f21b2958e..1708d1cd9a 100644 --- a/mapogr.cpp +++ b/mapogr.cpp @@ -32,6 +32,7 @@ #include "mapserver.h" #include "mapproject.h" #include "mapthread.h" +#include "mapows.h" #if defined(USE_OGR) || defined(USE_GDAL) # include "gdal_version.h" diff --git a/mapogroutput.c b/mapogroutput.c index 3fac96f116..ed12736aa9 100644 --- a/mapogroutput.c +++ b/mapogroutput.c @@ -31,6 +31,7 @@ #include "mapserver.h" #include "mapproject.h" #include "mapthread.h" +#include "mapows.h" #if defined(USE_OGR) # define __USE_LARGEFILE64 1 diff --git a/mapows.c b/mapows.c index 617abc317b..dd2d8562ed 100644 --- a/mapows.c +++ b/mapows.c @@ -30,6 +30,7 @@ #include "mapserver.h" #include "maptime.h" #include "maptemplate.h" +#include "mapows.h" #if defined(USE_LIBXML2) #include "maplibxml2.h" diff --git a/mapows.h b/mapows.h index 4d7f41f8db..b8be8cc3f5 100644 --- a/mapows.h +++ b/mapows.h @@ -40,6 +40,15 @@ */ #define OWS_DEFAULT_SCHEMAS_LOCATION "http://schemas.opengis.net" +#if defined USE_LIBXML2 && defined USE_WFS_SVR +#include +#endif + +#ifdef __cplusplus +extern "C" { +#endif + + /*==================================================================== * mapows.c *====================================================================*/ @@ -474,7 +483,6 @@ int msWFSException11(mapObj *map, const char *locator, int msWFSGetCapabilities11(mapObj *map, wfsParamsObj *wfsparams, cgiRequestObj *req, owsRequestObj *ows_request); #ifdef USE_LIBXML2 -#include xmlNodePtr msWFSDumpLayer11(mapObj *map, layerObj *lp, xmlNsPtr psNsOws, int nWFSVersion, const char* validate_language); #endif @@ -535,6 +543,9 @@ int msWCSDispatch(mapObj *map, cgiRequestObj *requestobj, owsRequestObj *ows_req int msSOSDispatch(mapObj *map, cgiRequestObj *requestobj, owsRequestObj *ows_request); /* only 1 public function */ +#ifdef __cplusplus +} /* extern "C" */ +#endif #endif /* MAPOWS_H */ diff --git a/mapserver.h b/mapserver.h index ec913805f0..e02dcb39bd 100644 --- a/mapserver.h +++ b/mapserver.h @@ -2805,12 +2805,6 @@ void msPopulateTextSymbolForLabelAndString(textSymbolObj *ts, labelObj *l, char MS_DLL_EXPORT void *msGetSymbol(const char *pszLibrary, const char *pszEntryPoint); - /* ==================================================================== */ - /* include definitions from mapows.h */ - /* ==================================================================== */ -#include "mapows.h" - - /* ==================================================================== */ /* prototypes for functions in mapgeos.c */ /* ==================================================================== */ diff --git a/mapwcs.c b/mapwcs.c index 3d5180e2db..380b6b200d 100644 --- a/mapwcs.c +++ b/mapwcs.c @@ -30,6 +30,7 @@ #include "mapserver.h" #include "maperror.h" #include "mapthread.h" +#include "mapows.h" #include diff --git a/mapwcs11.c b/mapwcs11.c index 0385f52e03..8dbe94829a 100644 --- a/mapwcs11.c +++ b/mapwcs11.c @@ -33,6 +33,7 @@ #include "mapserver.h" #include "maperror.h" #include "mapthread.h" +#include "mapows.h" #include "mapwcs.h" diff --git a/mapwcs20.c b/mapwcs20.c index 95351b8efa..ac2fb896c0 100644 --- a/mapwcs20.c +++ b/mapwcs20.c @@ -36,6 +36,7 @@ #include "mapserver.h" #include "maperror.h" #include "mapthread.h" +#include "mapows.h" #include "mapwcs.h" #include #include "gdal.h" diff --git a/mapwfs.c b/mapwfs.c index 0b2823331e..ed223d9789 100644 --- a/mapwfs.c +++ b/mapwfs.c @@ -28,6 +28,7 @@ ****************************************************************************/ #include "mapserver.h" +#include "mapows.h" diff --git a/mapwms.c b/mapwms.c index 17a3a09cf3..d681d12ed2 100644 --- a/mapwms.c +++ b/mapwms.c @@ -35,6 +35,7 @@ #include "mapgml.h" #include #include "maptemplate.h" +#include "mapows.h" #include "mapogcsld.h" #include "mapogcfilter.h" diff --git a/mapwmslayer.c b/mapwmslayer.c index 9ba8f24c54..42a44f135e 100644 --- a/mapwmslayer.c +++ b/mapwmslayer.c @@ -30,6 +30,7 @@ #include "mapserver.h" #include "maperror.h" #include "mapogcsld.h" +#include "mapows.h" #include #include