Skip to content

Commit d1ff73d

Browse files
committed
Fix for issue #12
1 parent 2927d43 commit d1ff73d

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

src/wxsqlite3.cpp

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4124,7 +4124,11 @@ int wxSQLite3Database::GetSystemErrorCode() const
41244124
return rc;
41254125
}
41264126

4127+
#if wxCHECK_VERSION(2,9,0)
4128+
static const wxStringCharType* limitCodeString[] =
4129+
#else
41274130
static const wxChar* limitCodeString[] =
4131+
#endif
41284132
{ wxS("SQLITE_LIMIT_LENGTH"), wxS("SQLITE_LIMIT_SQL_LENGTH"),
41294133
wxS("SQLITE_LIMIT_COLUMN"), wxS("SQLITE_LIMIT_EXPR_DEPTH"),
41304134
wxS("SQLITE_LIMIT_COMPOUND_SELECT"), wxS("SQLITE_LIMIT_VDBE_OP"),
@@ -4137,12 +4141,12 @@ static const wxChar* limitCodeString[] =
41374141
/* static */
41384142
wxString wxSQLite3Database::LimitTypeToString(wxSQLite3LimitType type)
41394143
{
4140-
const wxChar* limitString = wxS("Unknown");
4144+
wxString limitString(wxS("Unknown"));
41414145
if (type >= WXSQLITE_LIMIT_LENGTH && type <= WXSQLITE_LIMIT_WORKER_THREADS)
41424146
{
41434147
limitString = limitCodeString[type];
41444148
}
4145-
return wxString(limitString);
4149+
return limitString;
41464150
}
41474151

41484152
/* static */
@@ -4509,7 +4513,11 @@ int wxSQLite3FunctionContext::ExecWriteAheadLogHook(void* hook, void* dbHandle,
45094513
return (int) ((wxSQLite3Hook*) hook)->WriteAheadLogCallback(locDatabase, numPages);
45104514
}
45114515

4516+
#if wxCHECK_VERSION(2,9,0)
4517+
static const wxStringCharType* authCodeString[] =
4518+
#else
45124519
static const wxChar* authCodeString[] =
4520+
#endif
45134521
{ wxS("SQLITE_COPY"), wxS("SQLITE_CREATE_INDEX"), wxS("SQLITE_CREATE_TABLE"),
45144522
wxS("SQLITE_CREATE_TEMP_INDEX"), wxS("SQLITE_CREATE_TEMP_TABLE"), wxS("SQLITE_CREATE_TEMP_TRIGGER"),
45154523
wxS("SQLITE_CREATE_TEMP_VIEW"), wxS("SQLITE_CREATE_TRIGGER"), wxS("SQLITE_CREATE_VIEW"),
@@ -4528,12 +4536,12 @@ static const wxChar* authCodeString[] =
45284536
/* static */
45294537
wxString wxSQLite3Authorizer::AuthorizationCodeToString(wxSQLite3Authorizer::wxAuthorizationCode type)
45304538
{
4531-
const wxChar* authString = wxS("Unknown");
4539+
wxString authString(wxS("Unknown"));
45324540
if (type >= SQLITE_COPY && type <= SQLITE_MAX_CODE)
45334541
{
45344542
authString = authCodeString[type];
45354543
}
4536-
return wxString(authString);
4544+
return authString;
45374545
}
45384546

45394547
// ----------------------------------------------------------------------------

0 commit comments

Comments
 (0)