From 5600884ab7b33df1ba37cf488e6035d2228c3e56 Mon Sep 17 00:00:00 2001 From: David Webster Date: Mon, 21 May 2001 20:30:24 +0000 Subject: [PATCH] Visualage fixes for Stefan's socket implementations and true to TRUE in db.cpp git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@10258 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/db.cpp | 22 +++++++++++----------- src/common/utilscmn.cpp | 26 ++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 11 deletions(-) diff --git a/src/common/db.cpp b/src/common/db.cpp index b075f92a59..f0cb57a8fa 100644 --- a/src/common/db.cpp +++ b/src/common/db.cpp @@ -146,7 +146,7 @@ wxDbConnectInf::wxDbConnectInf() /********** wxDbConnectInf Constructor - form 2 **********/ -wxDbConnectInf::wxDbConnectInf(HENV henv, const wxString &dsn, const wxString &userID, +wxDbConnectInf::wxDbConnectInf(HENV henv, const wxString &dsn, const wxString &userID, const wxString &password, const wxString &defaultDir, const wxString &fileType, const wxString &description) { @@ -250,7 +250,7 @@ void wxDbConnectInf::SetUserID(const wxString &uid) void wxDbConnectInf::SetPassword(const wxString &password) { wxASSERT(password.Length() < sizeof(AuthStr)); - + wxStrcpy(AuthStr,password); } // wxDbConnectInf::SetPassword() @@ -1897,7 +1897,7 @@ bool wxDb::ExecSql(const wxString &pSqlStmt) SQLFreeStmt(hstmt, SQL_CLOSE); retcode = SQLExecDirect(hstmt, (UCHAR FAR *) pSqlStmt.c_str(), SQL_NTS); - if (retcode == SQL_SUCCESS || + if (retcode == SQL_SUCCESS || (Dbms() == dbmsDB2 && (retcode == SQL_SUCCESS_WITH_INFO || retcode == SQL_NO_DATA_FOUND))) { return(TRUE); @@ -3226,25 +3226,25 @@ bool wxDb::TablePrivileges(const wxString &tableName, const wxString &priv, cons while (retcode == SQL_SUCCESS || retcode == SQL_SUCCESS_WITH_INFO) { if (SQLGetData(hstmt, 1, SQL_C_CHAR, (UCHAR*) result.tableQual, sizeof(result.tableQual), &cbRetVal) != SQL_SUCCESS) - failed = true; + failed = TRUE; if (!failed && SQLGetData(hstmt, 2, SQL_C_CHAR, (UCHAR*) result.tableOwner, sizeof(result.tableOwner), &cbRetVal) != SQL_SUCCESS) - failed = true; + failed = TRUE; if (!failed && SQLGetData(hstmt, 3, SQL_C_CHAR, (UCHAR*) result.tableName, sizeof(result.tableName), &cbRetVal) != SQL_SUCCESS) - failed = true; + failed = TRUE; if (!failed && SQLGetData(hstmt, 4, SQL_C_CHAR, (UCHAR*) result.grantor, sizeof(result.grantor), &cbRetVal) != SQL_SUCCESS) - failed = true; + failed = TRUE; if (!failed && SQLGetData(hstmt, 5, SQL_C_CHAR, (UCHAR*) result.grantee, sizeof(result.grantee), &cbRetVal) != SQL_SUCCESS) - failed = true; + failed = TRUE; if (!failed && SQLGetData(hstmt, 6, SQL_C_CHAR, (UCHAR*) result.privilege, sizeof(result.privilege), &cbRetVal) != SQL_SUCCESS) - failed = true; + failed = TRUE; if (!failed && SQLGetData(hstmt, 7, SQL_C_CHAR, (UCHAR*) result.grantable, sizeof(result.grantable), &cbRetVal) != SQL_SUCCESS) - failed = true; + failed = TRUE; if (failed) { @@ -3480,7 +3480,7 @@ bool wxDb::ModifyColumn(const wxString &tableName, const wxString &columnName, // Must specify a columnLength if modifying a VARCHAR type column if (dataType == DB_DATA_TYPE_VARCHAR && !columnLength) return FALSE; - + wxString dataTypeName; wxString sqlStmt; wxString alterSlashModify; diff --git a/src/common/utilscmn.cpp b/src/common/utilscmn.cpp index 6020b8780d..9bc2b497f7 100644 --- a/src/common/utilscmn.cpp +++ b/src/common/utilscmn.cpp @@ -60,6 +60,32 @@ #if !defined(__WATCOMC__) #if !(defined(_MSC_VER) && (_MSC_VER > 800)) + // + // OS/2's App.h is being included first which includes nerrno.h + // so these are already defined. Undef them if defined before + // including errno.h + // + #ifdef EEXIST + #undef EEXIST + #endif + #ifdef ENOENT + #undef ENOENT + #endif + #ifdef EMFILE + #undef EMFILE + #endif + #ifdef EINTR + #undef EINTR + #endif + #ifdef EINVAL + #undef EINVAL + #endif + #ifdef ENOMEM + #undef ENOMEM + #endif + #ifdef EACCES + #undef EACCES + #endif #include #endif #endif -- 2.47.2