Fixed link errors calling Exception::getErrorCode()

getErrorCode() and getExtendedErrorCode()'s implementations were
accidentally declared as inline in the .cpp file. This causes the
compiler to not generate any code for them, resulting in link errors
when a client calls them.

Fixed by moving the implementations into the header, where they need to
be if they're inline.
This commit is contained in:
Jens Alfke 2016-08-04 16:35:45 -07:00
parent 9d1ea82313
commit 30e285ff89
2 changed files with 7 additions and 15 deletions

View File

@ -76,10 +76,14 @@ public:
Exception(sqlite3* apSQLite, int ret);
/// Return the result code (if any, otherwise -1).
int getErrorCode() const noexcept; // nothrow
int getErrorCode() const noexcept { // nothrow
return mErrcode;
}
/// Return the extended numeric result code (if any, otherwise -1).
int getExtendedErrorCode() const noexcept; // nothrow
int getExtendedErrorCode() const noexcept { // nothrow
return mExtendedErrcode;
}
/// Return a string, solely based on the error code
const char* getErrorStr() const noexcept; // nothrow

View File

@ -44,20 +44,8 @@ Exception::Exception(sqlite3* apSQLite, int ret) :
{
}
// Return the result code (if any, otherwise -1).
inline int Exception::getErrorCode() const noexcept // nothrow
{
return mErrcode;
}
// Return the extended numeric result code (if any, otherwise -1).
inline int Exception::getExtendedErrorCode() const noexcept // nothrow
{
return mExtendedErrcode;
}
// Return a string, solely based on the error code
inline const char* Exception::getErrorStr() const noexcept // nothrow
const char* Exception::getErrorStr() const noexcept // nothrow
{
return sqlite3_errstr(mErrcode);
}