Skip to content

Commit c7c9e8b

Browse files

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed
 

‎src/providers/grass/qgsgrass.cpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -985,17 +985,34 @@ bool QgsGrass::mapRegion( int type, QString gisbase,
985985
return true;
986986
}
987987

988+
// GRASS version constants have been changed on 26.4.2007
989+
// http://freegis.org/cgi-bin/viewcvs.cgi/grass6/include/version.h.in.diff?r1=1.4&r2=1.5
990+
// The following lines workaround this change
991+
988992
int QgsGrass::versionMajor()
989993
{
994+
#ifdef GRASS_VERSION_MAJOR
995+
return GRASS_VERSION_MAJOR;
996+
#else
990997
return QString(GRASS_VERSION_MAJOR).toInt();
998+
#endif
991999
}
9921000
int QgsGrass::versionMinor()
9931001
{
1002+
#ifdef GRASS_VERSION_MINOR
1003+
return GRASS_VERSION_MINOR;
1004+
#else
9941005
return QString(GRASS_VERSION_MINOR).toInt();
1006+
#endif
9951007
}
9961008
int QgsGrass::versionRelease()
9971009
{
1010+
#ifdef GRASS_VERSION_RELEASE
1011+
#define QUOTE(x) #x
1012+
return QString(QUOTE(GRASS_VERSION_RELEASE)).toInt();
1013+
#else
9981014
return QString(GRASS_VERSION_RELEASE).toInt();
1015+
#endif
9991016
}
10001017
QString QgsGrass::versionString()
10011018
{

0 commit comments

Comments
 (0)
Please sign in to comment.