Skip to content

Commit

Permalink
Add ACCEPT_USE_OF_DEPRECATED_PROJ_API_H macro for proj_api.h to work …
Browse files Browse the repository at this point in the history
…with new release of proj4.

(cherry picked from commit 6a7e951)
  • Loading branch information
swiss-knight authored and nyalldawson committed Nov 26, 2018
1 parent c2f16cf commit b5ad33f
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 3 deletions.
3 changes: 3 additions & 0 deletions src/app/qgisapp.cpp
Expand Up @@ -349,6 +349,9 @@ Q_GUI_EXPORT extern int qt_defaultDpiX();
#ifdef PROJ_HAS_INFO #ifdef PROJ_HAS_INFO
#include <proj.h> #include <proj.h>
#endif #endif
#ifndef ACCEPT_USE_OF_DEPRECATED_PROJ_API_H
#define ACCEPT_USE_OF_DEPRECATED_PROJ_API_H
#endif
#include <proj_api.h> #include <proj_api.h>


// //
Expand Down
3 changes: 3 additions & 0 deletions src/app/qgscustomprojectiondialog.cpp
Expand Up @@ -40,6 +40,9 @@
//proj4 includes //proj4 includes
extern "C" extern "C"
{ {
#ifndef ACCEPT_USE_OF_DEPRECATED_PROJ_API_H
#define ACCEPT_USE_OF_DEPRECATED_PROJ_API_H
#endif
#include <proj_api.h> #include <proj_api.h>
} }


Expand Down
4 changes: 4 additions & 0 deletions src/core/qgscoordinatereferencesystem.cpp
Expand Up @@ -38,6 +38,9 @@
#include "qgssettings.h" #include "qgssettings.h"


#include <sqlite3.h> #include <sqlite3.h>
#ifndef ACCEPT_USE_OF_DEPRECATED_PROJ_API_H
#define ACCEPT_USE_OF_DEPRECATED_PROJ_API_H
#endif
#include <proj_api.h> #include <proj_api.h>


//gdal and ogr includes (needed for == operator) //gdal and ogr includes (needed for == operator)
Expand All @@ -46,6 +49,7 @@
#include <cpl_conv.h> #include <cpl_conv.h>
#include <cpl_csv.h> #include <cpl_csv.h>



//! The length of the string "+lat_1=" //! The length of the string "+lat_1="
const int LAT_PREFIX_LEN = 7; const int LAT_PREFIX_LEN = 7;


Expand Down
3 changes: 3 additions & 0 deletions src/core/qgscoordinatetransform.cpp
Expand Up @@ -34,6 +34,9 @@


extern "C" extern "C"
{ {
#ifndef ACCEPT_USE_OF_DEPRECATED_PROJ_API_H
#define ACCEPT_USE_OF_DEPRECATED_PROJ_API_H
#endif
#include <proj_api.h> #include <proj_api.h>
} }
#include <sqlite3.h> #include <sqlite3.h>
Expand Down
3 changes: 3 additions & 0 deletions src/core/qgscoordinatetransform_p.cpp
Expand Up @@ -21,6 +21,9 @@


extern "C" extern "C"
{ {
#ifndef ACCEPT_USE_OF_DEPRECATED_PROJ_API_H
#define ACCEPT_USE_OF_DEPRECATED_PROJ_API_H
#endif
#include <proj_api.h> #include <proj_api.h>
} }
#include <sqlite3.h> #include <sqlite3.h>
Expand Down
9 changes: 6 additions & 3 deletions src/native/mac/qgsmacnative.mm
Expand Up @@ -122,12 +122,15 @@ - ( BOOL )userNotificationCenter:( NSUserNotificationCenter * )center shouldPres
bool QgsMacNative::hasDarkTheme() bool QgsMacNative::hasDarkTheme()
{ {
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= __MAC_10_14 #if __MAC_OS_X_VERSION_MAX_ALLOWED >= __MAC_10_14
if ([NSApp respondsToSelector:@selector(effectiveAppearance)]) { if ( [NSApp respondsToSelector:@selector( effectiveAppearance )] )
{
// compiled on macos 10.14+ AND running on macos 10.14+ // compiled on macos 10.14+ AND running on macos 10.14+
// check the settings of effective appearance of the user // check the settings of effective appearance of the user
NSAppearanceName appearanceName = [NSApp.effectiveAppearance bestMatchFromAppearancesWithNames:@[NSAppearanceNameAqua, NSAppearanceNameDarkAqua]]; NSAppearanceName appearanceName = [NSApp.effectiveAppearance bestMatchFromAppearancesWithNames:@[NSAppearanceNameAqua, NSAppearanceNameDarkAqua]];
return ([appearanceName isEqualToString:NSAppearanceNameDarkAqua]); return ( [appearanceName isEqualToString:NSAppearanceNameDarkAqua] );
} else { }
else
{
// compiled on macos 10.14+ BUT running on macos 10.13- // compiled on macos 10.14+ BUT running on macos 10.13-
// DarkTheme was introduced in MacOS 10.14, fallback to light theme // DarkTheme was introduced in MacOS 10.14, fallback to light theme
return false; return false;
Expand Down
3 changes: 3 additions & 0 deletions tests/src/core/testqgscoordinatereferencesystem.cpp
Expand Up @@ -24,6 +24,9 @@ Email : sherman at mrcc dot com
#include "qgsvectorlayer.h" #include "qgsvectorlayer.h"
#include "qgsproject.h" #include "qgsproject.h"


#ifndef ACCEPT_USE_OF_DEPRECATED_PROJ_API_H
#define ACCEPT_USE_OF_DEPRECATED_PROJ_API_H
#endif
#include <proj_api.h> #include <proj_api.h>
#include <gdal.h> #include <gdal.h>
#include <cpl_conv.h> #include <cpl_conv.h>
Expand Down

0 comments on commit b5ad33f

Please sign in to comment.