Skip to content

Commit

Permalink
Merge pull request #5939 from rouault/cpp11_c99
Browse files Browse the repository at this point in the history
Require C++11 and C99; bump CMake min version to 3.0
  • Loading branch information
rouault committed Dec 11, 2019
2 parents c4006da + 7f92bbd commit 33daf4b
Show file tree
Hide file tree
Showing 3 changed files with 119 additions and 151 deletions.
22 changes: 20 additions & 2 deletions CMakeLists.txt
@@ -1,4 +1,4 @@
cmake_minimum_required (VERSION 2.6)
cmake_minimum_required (VERSION 3.0)

project (MapServer)

Expand All @@ -20,6 +20,24 @@ set (MapServer_VERSION_MINOR 5)
set (MapServer_VERSION_REVISION 0)
set (MapServer_VERSION_SUFFIX "")

# Set C++ version
# Make CMAKE_CXX_STANDARD available as cache option overridable by user
set(CMAKE_CXX_STANDARD 11
CACHE STRING "C++ standard version to use (default is 11)")
message(STATUS "Requiring C++${CMAKE_CXX_STANDARD}")
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
message(STATUS "Requiring C++${CMAKE_CXX_STANDARD} - done")

# Set C99 version
# Make CMAKE_C_STANDARD available as cache option overridable by user
set(CMAKE_C_STANDARD 99
CACHE STRING "C standard version to use (default is 99)")
message(STATUS "Requiring C${CMAKE_C_STANDARD}")
set(CMAKE_C_STANDARD_REQUIRED ON)
set(CMAKE_C_EXTENSIONS OFF)
message(STATUS "Requiring C${CMAKE_C_STANDARD} - done")

set(TARGET_VERSION_MAJOR ${MapServer_VERSION_MAJOR})
set(TARGET_VERSION_MINOR ${MapServer_VERSION_MINOR})

Expand Down Expand Up @@ -260,7 +278,7 @@ maptree.c mapdebug.c maplexer.c mapquantization.c mapunion.c
mapdraw.c maplibxml2.c mapquery.c maputil.c strptime.c mapdrawgdal.c
mapraster.c mapuvraster.c mapdummyrenderer.c mapobject.c maprasterquery.c
mapwcs.c maperror.c mapogcfilter.c mapregex.c mapwcs11.c mapfile.c
mapogcfiltercommon.c maprendering.c mapwcs20.c mapogcsld.c mapmetadata.c
mapogcfiltercommon.cpp maprendering.c mapwcs20.c mapogcsld.c mapmetadata.c
mapresample.c mapwfs.c mapgdal.c mapogcsos.c mapscale.c mapwfs11.c mapwfs20.c
mapgeomtransform.c mapogroutput.c mapwfslayer.c mapagg.cpp mapkml.cpp
mapgeomutil.cpp mapkmlrenderer.cpp fontcache.c textlayout.c maputfgrid.cpp
Expand Down
16 changes: 11 additions & 5 deletions mapogcfilter.h
Expand Up @@ -31,11 +31,6 @@

#include "mapserver.h"

/*dont need ogr for these functikons*/
MS_DLL_EXPORT int FLTIsNumeric(const char *pszValue);
MS_DLL_EXPORT int FLTApplyExpressionToLayer(layerObj *lp, const char *pszExpression);
MS_DLL_EXPORT char *FLTGetExpressionForValuesRanges(layerObj *lp, const char *item, const char *value, int forcecharcter);

/* There is a dependency to OGR for the MiniXML parser */
#include "cpl_minixml.h"

Expand All @@ -45,6 +40,9 @@ MS_DLL_EXPORT char *FLTGetExpressionForValuesRanges(layerObj *lp, const char *i
#include<libxml/tree.h>
#endif

#ifdef __cplusplus
extern "C" {
#endif

typedef struct {
char *pszWildCard;
Expand All @@ -56,6 +54,10 @@ typedef struct {
/* -------------------------------------------------------------------- */
/* prototypes. */
/* -------------------------------------------------------------------- */
MS_DLL_EXPORT int FLTIsNumeric(const char *pszValue);
MS_DLL_EXPORT int FLTApplyExpressionToLayer(layerObj *lp, const char *pszExpression);
MS_DLL_EXPORT char *FLTGetExpressionForValuesRanges(layerObj *lp, const char *item, const char *value, int forcecharcter);

MS_DLL_EXPORT FilterEncodingNode *FLTParseFilterEncoding(const char *szXMLString);
MS_DLL_EXPORT FilterEncodingNode *FLTCreateFilterEncodingNode(void);
MS_DLL_EXPORT char** FLTSplitFilters(const char* pszStr, int* pnTokens);
Expand Down Expand Up @@ -143,4 +145,8 @@ int FLTApplyFilterToLayerCommonExpressionWithRect(mapObj *map, int iLayerIndex,
int FLTProcessPropertyIsNull(FilterEncodingNode *psFilterNode,
mapObj *map, int i);

#ifdef __cplusplus
}
#endif

#endif

0 comments on commit 33daf4b

Please sign in to comment.