From bba2982a19514543b7ad4a5b73c5eb12dc219096 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Fri, 12 Jan 2018 15:03:17 +0100 Subject: [PATCH] Fix compilation without GDAL and OGR (fixes #5539) --- mapdraw.c | 12 ++++++++---- mapio.c | 2 +- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/mapdraw.c b/mapdraw.c index f95b572855..013d2ee448 100644 --- a/mapdraw.c +++ b/mapdraw.c @@ -959,6 +959,7 @@ int msDrawVectorLayer(mapObj *map, layerObj *layer, imageObj *image) if((map->projection.numargs > 0) && (layer->projection.numargs > 0)) { int bDone = MS_FALSE; +#ifdef USE_GDAL if( layer->connectiontype == MS_UVRASTER ) { /* Nasty hack to make msUVRASTERLayerWhichShapes() aware that the */ @@ -966,6 +967,7 @@ int msDrawVectorLayer(mapObj *map, layerObj *layer, imageObj *image) /* Useful when dealin with UVRASTER that extend beyond 180 deg */ msUVRASTERLayerUseMapExtentAndProjectionForNextWhichShapes( layer, map ); } +#endif /* For UVRaster, it is important that the searchrect is not too large */ /* to avoid insufficient intermediate raster resolution, which could */ @@ -1041,10 +1043,10 @@ int msDrawVectorLayer(mapObj *map, layerObj *layer, imageObj *image) { /* otherwise clip the map extent with the reprojected layer */ /* extent */ - searchrect.minx = MAX( map_extent_minx, layer_extent.minx ); - searchrect.maxx = MIN( map_extent_maxx, layer_extent.maxx ); - searchrect.miny = MAX( map_extent_miny, layer_extent.miny ); - searchrect.maxy = MIN( map_extent_maxy, layer_extent.maxy ); + searchrect.minx = MS_MAX( map_extent_minx, layer_extent.minx ); + searchrect.maxx = MS_MIN( map_extent_maxx, layer_extent.maxx ); + searchrect.miny = MS_MAX( map_extent_miny, layer_extent.miny ); + searchrect.maxy = MS_MIN( map_extent_maxy, layer_extent.maxy ); /* and reproject into the layer projection */ msProjectRect(&map_proj, &layer->projection, &searchrect); } @@ -1067,10 +1069,12 @@ int msDrawVectorLayer(mapObj *map, layerObj *layer, imageObj *image) status = msLayerWhichShapes(layer, searchrect, MS_FALSE); +#ifdef USE_GDAL if( layer->connectiontype == MS_UVRASTER ) { msUVRASTERLayerUseMapExtentAndProjectionForNextWhichShapes( layer, NULL ); } +#endif if(status == MS_DONE) { /* no overlap */ msLayerClose(layer); diff --git a/mapio.c b/mapio.c index 10bbe49df8..4327ec6907 100644 --- a/mapio.c +++ b/mapio.c @@ -787,7 +787,7 @@ hashTableObj* msIO_getAndStripStdoutBufferMimeHeaders() /* Loop over all headers. */ /* -------------------------------------------------------------------- */ current_pos = 0; - while( TRUE ) { + while( MS_TRUE ) { int pos_of_column = -1; char* key, *value;