Skip to content

Commit 8a43e90

Browse files
committed
GRASS 7.0.0 API change
1 parent 4f36b65 commit 8a43e90

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

src/providers/grass/qgsgrass.cpp

-9
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,6 @@ extern "C"
5050
#endif
5151
}
5252

53-
#if GRASS_VERSION_MAJOR >= 7
54-
#define G_suppress_masking Rast_suppress_masking
55-
#define BOUND_BOX bound_box
56-
#endif
57-
58-
#if GRASS_VERSION_MAJOR > 7 || (GRASS_VERSION_MAJOR == 7 && GRASS_VERSION_MINOR >= 1)
59-
#define G_available_mapsets G_get_available_mapsets
60-
#endif
61-
6253
#if !defined(GRASS_VERSION_MAJOR) || \
6354
!defined(GRASS_VERSION_MINOR) || \
6455
GRASS_VERSION_MAJOR<6 || \

src/providers/grass/qgsgrass.h

+11-1
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,23 @@ class QgsRectangle;
4242
#define EXPAND(x) STR(x)
4343
#define GRASS_VERSION_RELEASE_STRING EXPAND( GRASS_VERSION_RELEASE )
4444

45-
#if (GRASS_VERSION_MAJOR < 7) || (GRASS_VERSION_MAJOR == 7 && GRASS_VERSION_MINOR == 0)
45+
#if (GRASS_VERSION_MAJOR < 7)
4646
#define G_TRY try { if( !setjmp( QgsGrass::jumper ) )
4747
#else
4848
#define G_TRY try { if( !setjmp(*G_fatal_longjmp(1)) )
4949
#endif
5050
#define G_CATCH else { throw QgsGrass::Exception( QgsGrass::errorMessage() ); } } catch
5151

52+
#if GRASS_VERSION_MAJOR >= 7
53+
#define G_available_mapsets G_get_available_mapsets
54+
#define G__mapset_permissions2 G_mapset_permissions2
55+
#define G_suppress_masking Rast_suppress_masking
56+
#define G__get_window G_get_element_window
57+
#define G__getenv G_getenv_nofatal
58+
#define G__setenv G_setenv_nogisrc
59+
#define BOUND_BOX bound_box
60+
#endif
61+
5262
/*!
5363
Methods for C library initialization and error handling.
5464
*/

0 commit comments

Comments
 (0)