From 272b3977483e80ca77179b796e7c347be63d82dc Mon Sep 17 00:00:00 2001 From: Olivier Bertrand Date: Wed, 9 Aug 2017 01:23:48 +0200 Subject: - Re-trying to fix Linux compile on DWORD. modified: storage/connect/odbconn.cpp modified: storage/connect/plgdbutl.cpp --- storage/connect/odbconn.cpp | 8 ++++++++ storage/connect/plgdbutl.cpp | 14 +++++--------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/storage/connect/odbconn.cpp b/storage/connect/odbconn.cpp index f29fb6b430b..70a0a6a1450 100644 --- a/storage/connect/odbconn.cpp +++ b/storage/connect/odbconn.cpp @@ -55,6 +55,7 @@ extern "C" HINSTANCE s_hModule; // Saved module handle TYPCONV GetTypeConv(); int GetConvSize(); +void OdbcClose(PGLOBAL g, PFBLOCK fp); /***********************************************************************/ /* Some macro's (should be defined elsewhere to be more accessible) */ @@ -301,6 +302,13 @@ static void ResetNullValues(CATPARM *cap) } // end of ResetNullValues #endif +/***********************************************************************/ +/* Close an ODBC table after a thrown error (called by PlugCloseFile) */ +/***********************************************************************/ +void OdbcClose(PGLOBAL g, PFBLOCK fp) { + ((ODBConn*)fp->File)->Close(); +} // end of OdbcClose + /***********************************************************************/ /* ODBCColumns: constructs the result blocks containing all columns */ /* of an ODBC table that will be retrieved by GetData commands. */ diff --git a/storage/connect/plgdbutl.cpp b/storage/connect/plgdbutl.cpp index e5a82dda50d..0943ce9f222 100644 --- a/storage/connect/plgdbutl.cpp +++ b/storage/connect/plgdbutl.cpp @@ -44,8 +44,6 @@ #include #define BIGMEM 1048576 // 1 Megabyte #else // !__WIN__ -// See comment in os.h -#define NODW #include #include //#if defined(THREAD) @@ -70,11 +68,6 @@ #include "tabcol.h" // header of XTAB and COLUMN classes #include "valblk.h" #include "rcmsg.h" -#if defined(ODBC_SUPPORT) -#include "tabext.h" -#include "odbccat.h" -#include "tabodbc.h" -#endif // ODBC_SUPPORT #ifdef ZIP_SUPPORT #include "filamzip.h" #endif // ZIP_SUPPORT @@ -121,6 +114,9 @@ void CloseXMLFile(PGLOBAL, PFBLOCK, bool); #include "libdoc.h" #endif // LIBXML2_SUPPORT +#ifdef ODBC_SUPPORT +void OdbcClose(PGLOBAL g, PFBLOCK fp); +#endif // ODBC_SUPPORT /***********************************************************************/ /* Routines for file IO with error reporting to g->Message */ @@ -887,7 +883,7 @@ FILE *PlugReopenFile(PGLOBAL g, PFBLOCK fp, LPCSTR md) /* Close file routine: the purpose of this routine is to avoid */ /* double closing that freeze the system on some Unix platforms. */ /***********************************************************************/ -int PlugCloseFile(PGLOBAL g __attribute__((unused)), PFBLOCK fp, bool all) +int PlugCloseFile(PGLOBAL g, PFBLOCK fp, bool all) { int rc = 0; @@ -938,7 +934,7 @@ int PlugCloseFile(PGLOBAL g __attribute__((unused)), PFBLOCK fp, bool all) #endif // LIBXML2_SUPPORT #ifdef ODBC_SUPPORT case TYPE_FB_ODBC: - ((ODBConn*)fp->File)->Close(); + OdbcClose(g, fp); fp->Count = 0; fp->File = NULL; break; -- cgit v1.2.1