Skip to content

Commit

Permalink
GRASS 7.0.0 API change
Browse files Browse the repository at this point in the history
  • Loading branch information
blazek committed Mar 12, 2015
1 parent 827f84e commit 1810cdd
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

3 comments on commit 1810cdd

@nyalldawson
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@blazek should this be backported to 2.8?

@blazek
Copy link
Member Author

@blazek blazek commented on 1810cdd Mar 13, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but first I have to fix the crash with GRASS 6 vectors. Both should be backported together.

@blazek
Copy link
Member Author

@blazek blazek commented on 1810cdd Apr 1, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Backported with 2 other fixes to release-2_8.

Please sign in to comment.