Skip to content

Commit

Permalink
osgeo4w: prepare for GDAL 2.3 update
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Oct 13, 2018
1 parent 85fdf4e commit 4f76722
Show file tree
Hide file tree
Showing 11 changed files with 32 additions and 10 deletions.
3 changes: 3 additions & 0 deletions CMakeLists.txt
Expand Up @@ -481,6 +481,9 @@ IF(MSVC)
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DQGISDEBUG=1")
# disable macros that offend std::numeric_limits<T>::min()/max()
ADD_DEFINITIONS(-DNOMINMAX)
IF(MSVC_VERSION LESS 1900)
ADD_DEFINITIONS(-DCPL_SUPRESS_CPLUSPLUS)
ENDIF(MSVC_VERSION LESS 1900)
ENDIF(MSVC)

IF(ENABLE_COVERAGE)
Expand Down
14 changes: 10 additions & 4 deletions src/analysis/raster/qgsalignraster.cpp
Expand Up @@ -15,9 +15,16 @@

#include "qgsalignraster.h"

#include <gdalwarper.h>
#include <ogr_srs_api.h>
#include <cpl_conv.h>

#if defined(_MSC_VER) && _MSC_VER >= 1600 && _MSC_VER < 1900
// we need GDALWarpKernel
#undef CPL_SUPRESS_CPLUSPLUS
#endif

#include <gdalwarper.h>

#include <limits>

#include <qmath.h>
Expand Down Expand Up @@ -503,9 +510,8 @@ bool QgsAlignRaster::createAndWarp( const Item& raster )
}

// Initialize and execute the warp operation.
GDALWarpOperation oOperation;
oOperation.Initialize( psWarpOptions );
oOperation.ChunkAndWarpImage( 0, 0, mXSize, mYSize );
GDALWarpOperationH oOperation = GDALCreateWarpOperation( psWarpOptions );
GDALChunkAndWarpImage( oOperation, 0, 0, mXSize, mYSize );

GDALDestroyGenImgProjTransformer( psWarpOptions->pTransformerArg );
GDALDestroyWarpOptions( psWarpOptions );
Expand Down
2 changes: 2 additions & 0 deletions src/app/qgsoptions.cpp
Expand Up @@ -62,7 +62,9 @@
#include <sqlite3.h>
#include "qgslogger.h"

#ifndef CPL_SUPRESS_CPLUSPLUS
#define CPL_SUPRESS_CPLUSPLUS
#endif
#include <gdal.h>
#include <geos_c.h>
#include <cpl_conv.h> // for setting gdal options
Expand Down
2 changes: 2 additions & 0 deletions src/core/qgsdataitem.cpp
Expand Up @@ -40,7 +40,9 @@
#include "qgsconfig.h"

// use GDAL VSI mechanism
#ifndef CPL_SUPRESS_CPLUSPLUS
#define CPL_SUPRESS_CPLUSPLUS
#endif
#include "cpl_vsi.h"
#include "cpl_string.h"

Expand Down
4 changes: 2 additions & 2 deletions src/plugins/georeferencer/qgsgeoreftransform.cpp
Expand Up @@ -18,11 +18,11 @@

#include <gdal.h>
#include <gdal_alg.h>
#include <cpl_string.h>

#include "qgsleastsquares.h"

#include <cmath>

#include <cassert>
#include <limits>

Expand Down Expand Up @@ -511,7 +511,7 @@ bool QgsGDALGeorefTransform::updateParametersFromGCPs( const QVector<QgsPoint> &
for ( int i = 0; i < n; i++ )
{
GCPList[i].pszId = new char[20];
snprintf( GCPList[i].pszId, 19, "gcp%i", i );
CPLsnprintf( GCPList[i].pszId, 19, "gcp%i", i );
GCPList[i].pszInfo = nullptr;
GCPList[i].dfGCPPixel = pixelCoords[i].x();
GCPList[i].dfGCPLine = -pixelCoords[i].y();
Expand Down
7 changes: 3 additions & 4 deletions src/plugins/georeferencer/qgsimagewarper.cpp
Expand Up @@ -252,15 +252,14 @@ int QgsImageWarper::warpFile( const QString& input,
adfGeoTransform );

// Initialize and execute the warp operation.
GDALWarpOperation oOperation;
oOperation.Initialize( psWarpOptions );
GDALWarpOperationH oOperation = GDALCreateWarpOperation( psWarpOptions );

progressDialog->show();
progressDialog->raise();
progressDialog->activateWindow();

eErr = oOperation.ChunkAndWarpImage( 0, 0, destPixels, destLines );
// eErr = oOperation.ChunkAndWarpMulti(0, 0, destPixels, destLines);
eErr = GDALChunkAndWarpImage( oOperation, 0, 0, destPixels, destLines );
// eErr = GDALChunkAndWarpMulti( oOperation, 0, 0, destPixels, destLines );

destroyGeoToPixelTransform( psWarpOptions->pTransformerArg );
GDALDestroyWarpOptions( psWarpOptions );
Expand Down
2 changes: 2 additions & 0 deletions src/providers/gdal/qgsgdalproviderbase.cpp
Expand Up @@ -15,7 +15,9 @@
* *
***************************************************************************/

#ifndef CPL_SUPRESS_CPLUSPLUS
#define CPL_SUPRESS_CPLUSPLUS
#endif
#include "cpl_conv.h"

#include "qgsapplication.h"
Expand Down
2 changes: 2 additions & 0 deletions src/providers/gdal/qgsgdalproviderbase.h
Expand Up @@ -23,7 +23,9 @@

#include <QList>

#ifndef CPL_SUPRESS_CPLUSPLUS
#define CPL_SUPRESS_CPLUSPLUS
#endif
#include <gdal.h>

#if defined(GDAL_VERSION_NUM) && GDAL_VERSION_NUM >= 1800
Expand Down
2 changes: 2 additions & 0 deletions src/providers/ogr/qgsogrprovider.cpp
Expand Up @@ -21,7 +21,9 @@ email : sherman at mrcc.com
#include "qgsmessagelog.h"
#include "qgslocalec.h"

#ifndef CPL_SUPRESS_CPLUSPLUS
#define CPL_SUPRESS_CPLUSPLUS
#endif
#include <gdal.h> // to collect version information
#include <ogr_api.h>
#include <ogr_srs_api.h>
Expand Down
2 changes: 2 additions & 0 deletions src/providers/wcs/qgswcsprovider.h
Expand Up @@ -44,7 +44,9 @@ class QNetworkAccessManager;
class QNetworkReply;
class QNetworkRequest;

#ifndef CPL_SUPRESS_CPLUSPLUS
#define CPL_SUPRESS_CPLUSPLUS
#endif
#include <gdal.h>
#include "cpl_conv.h"

Expand Down
2 changes: 2 additions & 0 deletions tests/src/core/testqgsapplication.cpp
Expand Up @@ -15,7 +15,9 @@ Email : sherman at mrcc dot com
#include <QtTest/QtTest>
#include <QPixmap>

#ifndef CPL_SUPRESS_CPLUSPLUS
#define CPL_SUPRESS_CPLUSPLUS
#endif
#include <gdal.h>

//header for class being tested
Expand Down

0 comments on commit 4f76722

Please sign in to comment.