Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Workaround for change in GRASS's version.h in cvs >= 26.4.2007
git-svn-id: http://svn.osgeo.org/qgis/trunk@6923 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
wonder committed May 1, 2007
1 parent 147876d commit c17fe79
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/providers/grass/qgsgrass.cpp
Expand Up @@ -985,17 +985,34 @@ bool QgsGrass::mapRegion( int type, QString gisbase,
return true;
}

// GRASS version constants have been changed on 26.4.2007
// http://freegis.org/cgi-bin/viewcvs.cgi/grass6/include/version.h.in.diff?r1=1.4&r2=1.5
// The following lines workaround this change

int QgsGrass::versionMajor()
{
#ifdef GRASS_VERSION_MAJOR
return GRASS_VERSION_MAJOR;
#else
return QString(GRASS_VERSION_MAJOR).toInt();
#endif
}
int QgsGrass::versionMinor()
{
#ifdef GRASS_VERSION_MINOR
return GRASS_VERSION_MINOR;
#else
return QString(GRASS_VERSION_MINOR).toInt();
#endif
}
int QgsGrass::versionRelease()
{
#ifdef GRASS_VERSION_RELEASE
#define QUOTE(x) #x
return QString(QUOTE(GRASS_VERSION_RELEASE)).toInt();
#else
return QString(GRASS_VERSION_RELEASE).toInt();
#endif
}
QString QgsGrass::versionString()
{
Expand Down

0 comments on commit c17fe79

Please sign in to comment.