From 2df4087a702d6828d3824fcc96d27b2fdd2b958c Mon Sep 17 00:00:00 2001
From: Hiroshi Inoue <inoue@tpf.co.jp>
Date: Mon, 24 Sep 2001 00:05:59 +0000
Subject: [PATCH] 1) Fix compile errors on Windows. 2) Change *Common* -->
 *Default*.

---
 src/interfaces/odbc/convert.c   |  3 ++-
 src/interfaces/odbc/environ.c   |  3 +++
 src/interfaces/odbc/odbcapi.c   |  5 ++---
 src/interfaces/odbc/odbcapi30.c |  3 +--
 src/interfaces/odbc/psqlodbc.h  | 17 ++++++++++++++++-
 src/interfaces/odbc/psqlodbc.rc |  4 ++--
 6 files changed, 26 insertions(+), 9 deletions(-)

diff --git a/src/interfaces/odbc/convert.c b/src/interfaces/odbc/convert.c
index 03d1b0817bc..c0a4e211c52 100644
--- a/src/interfaces/odbc/convert.c
+++ b/src/interfaces/odbc/convert.c
@@ -1013,7 +1013,8 @@ copy_statement_with_parameters(StatementClass *stmt)
 			stmt->options.scroll_concurrency = SQL_CONCUR_READ_ONLY;
 		else if (!stmt->ti || stmt->ntab != 1)
     			stmt->options.scroll_concurrency = SQL_CONCUR_READ_ONLY;
-		else search_from_pos = TRUE;
+		else
+			search_from_pos = TRUE;
 	}
 #endif /* DRIVER_CURSOR_IMPLEMENT */
 
diff --git a/src/interfaces/odbc/environ.c b/src/interfaces/odbc/environ.c
index 0471e1f4284..072987f1650 100644
--- a/src/interfaces/odbc/environ.c
+++ b/src/interfaces/odbc/environ.c
@@ -514,6 +514,9 @@ EN_Destructor(EnvironmentClass *self)
 	free(self);
 
 	mylog("exit EN_Destructor: rv = %d\n", rv);
+#ifdef	_MEMORY_DEBUG_
+debug_memory_inouecheck();
+#endif /* _MEMORY_DEBUG_ */
 	return rv;
 }
 
diff --git a/src/interfaces/odbc/odbcapi.c b/src/interfaces/odbc/odbcapi.c
index 9718aa9ff3a..cec41ea2e66 100644
--- a/src/interfaces/odbc/odbcapi.c
+++ b/src/interfaces/odbc/odbcapi.c
@@ -26,11 +26,10 @@
  *-------
  */
 
-#include "psqlodbc.h"
 #ifdef	WIN32
-#undef	ODBCVER
-#define	ODBCVER	0x3000
+#define	ODBCVER_REP	0x3000
 #endif
+#include "psqlodbc.h"
 #include <stdio.h>
 #include <string.h>
 
diff --git a/src/interfaces/odbc/odbcapi30.c b/src/interfaces/odbc/odbcapi30.c
index 24688583efd..cce9c37d426 100644
--- a/src/interfaces/odbc/odbcapi30.c
+++ b/src/interfaces/odbc/odbcapi30.c
@@ -18,9 +18,8 @@
  *-------
  */
 
+#define ODBCVER_REP 0x0300
 #include "psqlodbc.h"
-#undef ODBCVER
-#define ODBCVER 0x0300
 #include <stdio.h>
 #include <string.h>
 
diff --git a/src/interfaces/odbc/psqlodbc.h b/src/interfaces/odbc/psqlodbc.h
index 94b9c76701e..d923be139dd 100644
--- a/src/interfaces/odbc/psqlodbc.h
+++ b/src/interfaces/odbc/psqlodbc.h
@@ -5,7 +5,7 @@
  *
  * Comments:		See "notice.txt" for copyright and license information.
  *
- * $Id: psqlodbc.h,v 1.49 2001/09/22 22:54:33 petere Exp $
+ * $Id: psqlodbc.h,v 1.50 2001/09/24 00:05:59 inoue Exp $
  *
  */
 
@@ -21,7 +21,11 @@
 #include <stdio.h>				/* for FILE* pointers: see GLOBAL_VALUES */
 
 /* Must come before sql.h */
+#ifdef	ODBCVER_REP
+#define ODBCVER						ODBCVER_REP
+#else
 #define ODBCVER						0x0250
+#endif	/* ODBCVER_REP */
 
 
 #if defined(WIN32) || defined(WITH_UNIXODBC) || defined(WITH_IODBC)
@@ -232,4 +236,15 @@ queries used in info.c inoue 2001/05/17 */
 
 #include "misc.h"
 
+#ifdef	_MEMORY_DEBUG_
+void * debug_alloc(size_t);
+void * debug_realloc(void *, size_t);
+char * debug_strdup(const char *);
+void	debug_free(void *);
+void	debug_memory_check(void);
+#define	malloc	debug_alloc
+#define	realloc	debug_realloc
+#define	strdup	debug_strdup
+#define	free	debug_free
+#endif /* _MEMORY_DEBUG_ */
 #endif
diff --git a/src/interfaces/odbc/psqlodbc.rc b/src/interfaces/odbc/psqlodbc.rc
index de2dea24289..8a0ecd03b24 100644
--- a/src/interfaces/odbc/psqlodbc.rc
+++ b/src/interfaces/odbc/psqlodbc.rc
@@ -134,7 +134,7 @@ BEGIN
     DEFPUSHBUTTON   "OK",IDOK,59,201,50,14,WS_GROUP
     PUSHBUTTON      "Cancel",IDCANCEL,124,201,50,14
     PUSHBUTTON      "Defaults",IDDEFAULTS,189,201,50,15
-    CONTROL         "Common",DRV_OR_DSN,"Button",BS_AUTOCHECKBOX | BS_LEFTTEXT |
+    CONTROL         "Default",DRV_OR_DSN,"Button",BS_AUTOCHECKBOX | BS_LEFTTEXT |
                     BS_NOTIFY | WS_TABSTOP,233,208,40,10
 END
 
@@ -251,7 +251,7 @@ BEGIN
     DEFPUSHBUTTON   "OK",IDOK,45,220,50,14,WS_GROUP
     PUSHBUTTON      "Cancel",IDCANCEL,110,220,50,14
     PUSHBUTTON      "Defaults",IDDEFAULTS,175,220,50,15
-    CONTROL         "Common",DRV_OR_DSN,"Button",BS_AUTOCHECKBOX | BS_LEFTTEXT |
+    CONTROL         "Default",DRV_OR_DSN,"Button",BS_AUTOCHECKBOX | BS_LEFTTEXT |
                     BS_NOTIFY | WS_TABSTOP,233,224,40,10
 END
 
-- 
GitLab