From c497d0b2123337d89fe5d35c25a2f37026b7dba9 Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Sat, 16 Apr 2005 09:45:32 +0000 Subject: [PATCH] Applied patch [ 1183157 ] Compilation with GCC 4.0 by Michal Cihar. Also added typedef for SQLINTEGER in built-in iODBC. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@33648 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/db.h | 2 +- src/common/db.cpp | 12 ++---------- src/iodbc/isql.h | 5 +++-- 3 files changed, 6 insertions(+), 13 deletions(-) diff --git a/include/wx/db.h b/include/wx/db.h index 827e35cdbc..2b66a88b4a 100644 --- a/include/wx/db.h +++ b/include/wx/db.h @@ -613,7 +613,7 @@ public: wxChar errorList[DB_MAX_ERROR_HISTORY][DB_MAX_ERROR_MSG_LEN]; #endif wxChar errorMsg[SQL_MAX_MESSAGE_LENGTH]; - SDWORD nativeError; + SQLINTEGER nativeError; wxChar sqlState[20]; #if wxODBC_BACKWARD_COMPATABILITY diff --git a/src/common/db.cpp b/src/common/db.cpp index 85d53a78f0..97235899a4 100644 --- a/src/common/db.cpp +++ b/src/common/db.cpp @@ -1790,11 +1790,7 @@ bool wxDb::DispAllErrors(HENV aHenv, HDBC aHdbc, HSTMT aHstmt) { wxString odbcErrMsg; -#ifdef __VMS - while (SQLError(aHenv, aHdbc, aHstmt, (SQLTCHAR FAR *) sqlState, (SQLINTEGER *) &nativeError, (SQLTCHAR FAR *) errorMsg, SQL_MAX_MESSAGE_LENGTH - 1, &cbErrorMsg) == SQL_SUCCESS) -#else - while (SQLError(aHenv, aHdbc, aHstmt, (SQLTCHAR FAR *) sqlState, (long*) &nativeError, (SQLTCHAR FAR *) errorMsg, SQL_MAX_MESSAGE_LENGTH - 1, &cbErrorMsg) == SQL_SUCCESS) -#endif + while (SQLError(aHenv, aHdbc, aHstmt, (SQLTCHAR FAR *) sqlState, &nativeError, (SQLTCHAR FAR *) errorMsg, SQL_MAX_MESSAGE_LENGTH - 1, &cbErrorMsg) == SQL_SUCCESS) { odbcErrMsg.Printf(wxT("SQL State = %s\nNative Error Code = %li\nError Message = %s\n"), sqlState, nativeError, errorMsg); logError(odbcErrMsg, sqlState); @@ -1821,11 +1817,7 @@ bool wxDb::DispAllErrors(HENV aHenv, HDBC aHdbc, HSTMT aHstmt) /********** wxDb::GetNextError() **********/ bool wxDb::GetNextError(HENV aHenv, HDBC aHdbc, HSTMT aHstmt) { -#ifdef __VMS - if (SQLError(aHenv, aHdbc, aHstmt, (SQLTCHAR FAR *) sqlState, (SQLINTEGER *) &nativeError, (SQLTCHAR FAR *) errorMsg, SQL_MAX_MESSAGE_LENGTH - 1, &cbErrorMsg) == SQL_SUCCESS) -#else - if (SQLError(aHenv, aHdbc, aHstmt, (SQLTCHAR FAR *) sqlState, (long*) &nativeError, (SQLTCHAR FAR *) errorMsg, SQL_MAX_MESSAGE_LENGTH - 1, &cbErrorMsg) == SQL_SUCCESS) -#endif + if (SQLError(aHenv, aHdbc, aHstmt, (SQLTCHAR FAR *) sqlState, &nativeError, (SQLTCHAR FAR *) errorMsg, SQL_MAX_MESSAGE_LENGTH - 1, &cbErrorMsg) == SQL_SUCCESS) return true; else return false; diff --git a/src/iodbc/isql.h b/src/iodbc/isql.h index 971a0dc037..e3658afd30 100644 --- a/src/iodbc/isql.h +++ b/src/iodbc/isql.h @@ -6,8 +6,8 @@ * iODBC defines * * The iODBC driver manager. - * - * Copyright (C) 1995 by Ke Jin + * + * Copyright (C) 1995 by Ke Jin * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -47,6 +47,7 @@ typedef long int SDWORD; typedef short int SWORD; typedef unsigned long int UDWORD; typedef unsigned short int UWORD; +typedef long SQLINTEGER; typedef void FAR *PTR; typedef void FAR *HENV;