Skip to content

Commit 1754752

Browse files
committed
Avoid including header files inside an extern C block (#5117)
1 parent e91f7b2 commit 1754752

19 files changed

+29
-8
lines changed

mapcontext.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
****************************************************************************/
2828

2929
#include "mapserver.h"
30-
30+
#include "mapows.h"
3131

3232

3333
#if defined(USE_WMS_LYR) && defined(USE_OGR)

mapdraw.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
#include "maptime.h"
3434
#include "mapcopy.h"
3535
#include "mapfile.h"
36+
#include "mapows.h"
3637

3738

3839
/* msPrepareImage()

mapgml.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929

3030
#include "mapserver.h"
3131
#include "maperror.h"
32+
#include "mapows.h"
3233
#include "mapgml.h"
3334
#include "maptime.h"
3435

mapkmlrenderer.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
#include "maperror.h"
3535
#include "mapkmlrenderer.h"
3636
#include "mapio.h"
37+
#include "mapows.h"
3738

3839
#if defined(USE_OGR)
3940
# include "cpl_conv.h"

mapobject.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
****************************************************************************/
3030

3131
#include "mapserver.h"
32+
#include "mapows.h"
3233

3334
#ifdef USE_GDAL
3435
# include "gdal.h"

mapogcfilter.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
#include "mapserver.h"
4040
#include "mapowscommon.h"
4141
#include "maptime.h"
42+
#include "mapows.h"
4243

4344
static int FLTHasUniqueTopLevelDuringFilter(FilterEncodingNode *psFilterNode);
4445

mapogcsld.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#include "mapogcsld.h"
3030
#include "mapogcfilter.h"
3131
#include "mapserver.h"
32+
#include "mapows.h"
3233

3334
#ifdef USE_OGR
3435
#include "cpl_string.h"

mapogcsos.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
#define _GNU_SOURCE
3131

3232
#include "mapserver.h"
33+
#include "mapows.h"
3334

3435
#if defined(USE_SOS_SVR) && defined(USE_LIBXML2)
3536

mapogr.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
#include "mapserver.h"
3333
#include "mapproject.h"
3434
#include "mapthread.h"
35+
#include "mapows.h"
3536

3637
#if defined(USE_OGR) || defined(USE_GDAL)
3738
# include "gdal_version.h"

mapogroutput.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
#include "mapserver.h"
3232
#include "mapproject.h"
3333
#include "mapthread.h"
34+
#include "mapows.h"
3435

3536
#if defined(USE_OGR)
3637
# define __USE_LARGEFILE64 1

mapows.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
#include "mapserver.h"
3131
#include "maptime.h"
3232
#include "maptemplate.h"
33+
#include "mapows.h"
3334

3435
#if defined(USE_LIBXML2)
3536
#include "maplibxml2.h"

mapows.h

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,15 @@
4040
*/
4141
#define OWS_DEFAULT_SCHEMAS_LOCATION "http://schemas.opengis.net"
4242

43+
#if defined USE_LIBXML2 && defined USE_WFS_SVR
44+
#include<libxml/tree.h>
45+
#endif
46+
47+
#ifdef __cplusplus
48+
extern "C" {
49+
#endif
50+
51+
4352
/*====================================================================
4453
* mapows.c
4554
*====================================================================*/
@@ -474,7 +483,6 @@ int msWFSException11(mapObj *map, const char *locator,
474483
int msWFSGetCapabilities11(mapObj *map, wfsParamsObj *wfsparams,
475484
cgiRequestObj *req, owsRequestObj *ows_request);
476485
#ifdef USE_LIBXML2
477-
#include<libxml/tree.h>
478486
xmlNodePtr msWFSDumpLayer11(mapObj *map, layerObj *lp, xmlNsPtr psNsOws,
479487
int nWFSVersion, const char* validate_language);
480488
#endif
@@ -535,6 +543,9 @@ int msWCSDispatch(mapObj *map, cgiRequestObj *requestobj, owsRequestObj *ows_req
535543

536544
int msSOSDispatch(mapObj *map, cgiRequestObj *requestobj, owsRequestObj *ows_request); /* only 1 public function */
537545

546+
#ifdef __cplusplus
547+
} /* extern "C" */
548+
#endif
538549

539550
#endif /* MAPOWS_H */
540551

mapserver.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2805,12 +2805,6 @@ void msPopulateTextSymbolForLabelAndString(textSymbolObj *ts, labelObj *l, char
28052805
MS_DLL_EXPORT void *msGetSymbol(const char *pszLibrary,
28062806
const char *pszEntryPoint);
28072807

2808-
/* ==================================================================== */
2809-
/* include definitions from mapows.h */
2810-
/* ==================================================================== */
2811-
#include "mapows.h"
2812-
2813-
28142808
/* ==================================================================== */
28152809
/* prototypes for functions in mapgeos.c */
28162810
/* ==================================================================== */

mapwcs.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
#include "mapserver.h"
3131
#include "maperror.h"
3232
#include "mapthread.h"
33+
#include "mapows.h"
3334
#include <assert.h>
3435

3536

mapwcs11.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
#include "mapserver.h"
3434
#include "maperror.h"
3535
#include "mapthread.h"
36+
#include "mapows.h"
3637
#include "mapwcs.h"
3738

3839

mapwcs20.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
#include "mapserver.h"
3737
#include "maperror.h"
3838
#include "mapthread.h"
39+
#include "mapows.h"
3940
#include "mapwcs.h"
4041
#include <float.h>
4142
#include "gdal.h"

mapwfs.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
****************************************************************************/
2929

3030
#include "mapserver.h"
31+
#include "mapows.h"
3132

3233

3334

mapwms.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
#include "mapgml.h"
3636
#include <ctype.h>
3737
#include "maptemplate.h"
38+
#include "mapows.h"
3839

3940
#include "mapogcsld.h"
4041
#include "mapogcfilter.h"

mapwmslayer.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
#include "mapserver.h"
3131
#include "maperror.h"
3232
#include "mapogcsld.h"
33+
#include "mapows.h"
3334

3435
#include <time.h>
3536
#include <ctype.h>

0 commit comments

Comments
 (0)