Skip to content

Commit

Permalink
make 0.11 compile with grass 6.4
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/branches/Release-0_11_0@9719 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Nov 29, 2008
1 parent 3e7692c commit 7d9c4ad
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/plugins/grass/qgsgrassplugin.cpp
Expand Up @@ -496,7 +496,12 @@ void QgsGrassPlugin::newVector()
return;
}

#if defined(GRASS_VERSION_MAJOR) && defined(GRASS_VERSION_MINOR) && \
( ( GRASS_VERSION_MAJOR == 6 && GRASS_VERSION_MINOR >= 4 ) || GRASS_VERSION_MAJOR > 6 )
Vect_build ( &Map );
#else
Vect_build ( &Map, stderr );
#endif
Vect_set_release_support ( &Map );
Vect_close ( &Map );

Expand Down
12 changes: 12 additions & 0 deletions src/providers/grass/qgsgrassprovider.cpp
Expand Up @@ -46,6 +46,7 @@ extern "C" {
#include <grass/gis.h>
#include <grass/dbmi.h>
#include <grass/Vect.h>
#include <grass/version.h>
}

#ifdef _MSC_VER
Expand Down Expand Up @@ -1037,7 +1038,12 @@ int QgsGrassProvider::openMap(QString gisdbase, QString location, QString mapset
if ( level == 1 )
{
QgsGrass::resetError();
#if defined(GRASS_VERSION_MAJOR) && defined(GRASS_VERSION_MINOR) && \
( ( GRASS_VERSION_MAJOR == 6 && GRASS_VERSION_MINOR >= 4 ) || GRASS_VERSION_MAJOR > 6 )
Vect_build ( map.map );
#else
Vect_build ( map.map, stderr );
#endif

if ( QgsGrass::getError() == QgsGrass::FATAL ) {
std::cerr << "Cannot build topology: "
Expand Down Expand Up @@ -1492,8 +1498,14 @@ bool QgsGrassProvider::closeEdit ( bool newMap )
// TODO: Is it necessary for build/close ?
G__setenv( (char *)"MAPSET", (char *) map->mapset.ascii() );

#if defined(GRASS_VERSION_MAJOR) && defined(GRASS_VERSION_MINOR) && \
( ( GRASS_VERSION_MAJOR == 6 && GRASS_VERSION_MINOR >= 4 ) || GRASS_VERSION_MAJOR > 6 )
Vect_build_partial ( map->map, GV_BUILD_NONE);
Vect_build ( map->map );
#else
Vect_build_partial ( map->map, GV_BUILD_NONE, NULL);
Vect_build ( map->map, stderr );
#endif

// If a new map was created close the map and return
if ( newMap )
Expand Down

0 comments on commit 7d9c4ad

Please sign in to comment.