Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
GRASS 7.0.0 API change
  • Loading branch information
blazek committed Mar 31, 2015
1 parent 4f36b65 commit 8a43e90
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
9 changes: 0 additions & 9 deletions src/providers/grass/qgsgrass.cpp
Expand Up @@ -50,15 +50,6 @@ extern "C"
#endif
}

#if GRASS_VERSION_MAJOR >= 7
#define G_suppress_masking Rast_suppress_masking
#define BOUND_BOX bound_box
#endif

#if GRASS_VERSION_MAJOR > 7 || (GRASS_VERSION_MAJOR == 7 && GRASS_VERSION_MINOR >= 1)
#define G_available_mapsets G_get_available_mapsets
#endif

#if !defined(GRASS_VERSION_MAJOR) || \
!defined(GRASS_VERSION_MINOR) || \
GRASS_VERSION_MAJOR<6 || \
Expand Down
12 changes: 11 additions & 1 deletion src/providers/grass/qgsgrass.h
Expand Up @@ -42,13 +42,23 @@ class QgsRectangle;
#define EXPAND(x) STR(x)
#define GRASS_VERSION_RELEASE_STRING EXPAND( GRASS_VERSION_RELEASE )

#if (GRASS_VERSION_MAJOR < 7) || (GRASS_VERSION_MAJOR == 7 && GRASS_VERSION_MINOR == 0)
#if (GRASS_VERSION_MAJOR < 7)
#define G_TRY try { if( !setjmp( QgsGrass::jumper ) )
#else
#define G_TRY try { if( !setjmp(*G_fatal_longjmp(1)) )
#endif
#define G_CATCH else { throw QgsGrass::Exception( QgsGrass::errorMessage() ); } } catch

#if GRASS_VERSION_MAJOR >= 7
#define G_available_mapsets G_get_available_mapsets
#define G__mapset_permissions2 G_mapset_permissions2
#define G_suppress_masking Rast_suppress_masking
#define G__get_window G_get_element_window
#define G__getenv G_getenv_nofatal
#define G__setenv G_setenv_nogisrc
#define BOUND_BOX bound_box
#endif

/*!
Methods for C library initialization and error handling.
*/
Expand Down

0 comments on commit 8a43e90

Please sign in to comment.