Skip to content

Commit

Permalink
Ported r6894 to 0.8 branch (workaround for G_set_error_routine)
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/branches/Release-0_8_0@6932 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
wonder committed May 6, 2007
1 parent 9f1b42c commit e73403d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/providers/grass/qgsgrass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,10 @@ QString QgsGrass::mGisrc;
QString QgsGrass::mTmp;

int QgsGrass::error_routine ( char *msg, int fatal) {
return error_routine((const char*) msg, fatal);
}

int QgsGrass::error_routine ( const char *msg, int fatal) {
std::cerr << "error_routine (fatal = " << fatal << "): " << msg << std::endl;

if ( fatal ) error = FATAL;
Expand Down
5 changes: 5 additions & 0 deletions src/providers/grass/qgsgrass.h
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,11 @@ class QgsGrass {
static GERROR error; // static, because used in constructor
static QString error_message;

// G_set_error_routine has two versions of the function's first argument it expects:
// - char* msg - older version
// - const char* msg - in CVS from 04/2007
// this way compiler chooses suitable call
static int error_routine ( const char *msg, int fatal); // static because pointer to this function is set later
static int error_routine ( char *msg, int fatal); // static because pointer to this function is set later

// Current mapset lock file path
Expand Down

0 comments on commit e73403d

Please sign in to comment.