diff -Nur tcc-0.9.26.orig/configure tcc-0.9.26/configure
--- tcc-0.9.26.orig/configure	2013-02-15 15:24:00.000000000 +0100
+++ tcc-0.9.26/configure	2013-11-03 08:55:21.000000000 +0100
@@ -158,7 +158,7 @@
   ;;
   --enable-gprof) gprof="yes"
   ;;
-  --enable-mingw32) mingw32="yes" ; cross_prefix="i686-pc-mingw32-" ; cpu=x86
+  --enable-mingw32) mingw32="yes" ; cross_prefix="x86_64-w64-mingw32-" ; cpu=x86
   ;;
   --enable-cygwin) mingw32="yes" ; cygwin="yes" ; cross_prefix="mingw32-" ; cpu=x86
   ;;
@@ -363,14 +363,14 @@
 cat >config.mak <<EOF
 # Automatically generated by configure - do not modify
 prefix=$prefix
-bindir=\$(DESTDIR)$bindir
-tccdir=\$(DESTDIR)$tccdir
-libdir=\$(DESTDIR)$libdir
+bindir=$bindir
+tccdir=$tccdir
+libdir=$libdir
 ln_libdir=$libdir
-includedir=\$(DESTDIR)$includedir
-mandir=\$(DESTDIR)$mandir
-infodir=\$(DESTDIR)$infodir
-docdir=\$(DESTDIR)$docdir
+includedir=$includedir
+mandir=$mandir
+infodir=$infodir
+docdir=$docdir
 CC=$cc
 GCC_MAJOR=$gcc_major
 GCC_MINOR=$gcc_minor
diff -Nur tcc-0.9.26.orig/cross-configure.sh tcc-0.9.26/cross-configure.sh
--- tcc-0.9.26.orig/cross-configure.sh	1970-01-01 01:00:00.000000000 +0100
+++ tcc-0.9.26/cross-configure.sh	2013-11-03 08:51:07.000000000 +0100
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+CONFIG_SHELL=/bin/sh
+export CONFIG_SHELL
+PREFIX=/opt/mingw64
+TARGET=x86_64-w64-mingw32
+PATH="$PREFIX/bin:$PREFIX/$TARGET/bin:$PATH"
+export PATH
+sh configure "$@"
+status=$?
+rm -f "$cache"
+exit $status
diff -Nur tcc-0.9.26.orig/cross-make.sh tcc-0.9.26/cross-make.sh
--- tcc-0.9.26.orig/cross-make.sh	1970-01-01 01:00:00.000000000 +0100
+++ tcc-0.9.26/cross-make.sh	2013-11-03 08:29:45.000000000 +0100
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+PREFIX=/opt/mingw64
+TARGET=x86_64-w64-mingw32
+PATH="$PREFIX/bin:$PREFIX/$TARGET/bin:$PATH"
+export PATH
+exec make "$@"
diff -Nur tcc-0.9.26.orig/libtcc.c tcc-0.9.26/libtcc.c
--- tcc-0.9.26.orig/libtcc.c	2013-02-15 15:24:00.000000000 +0100
+++ tcc-0.9.26/libtcc.c	2013-11-03 08:29:45.000000000 +0100
@@ -129,6 +129,15 @@
     return TRUE;
 }
 #endif
+
+LIBTCCAPI void tcc_set_lib_path_mod(TCCState *s, void *module_handle)
+{
+    char path[1024], *p;
+    GetModuleFileNameA(module_handle, path, sizeof path);
+    p = tcc_basename(normalize_slashes(strlwr(path)));
+    if (p) *p = 0;
+    tcc_set_lib_path(s, path);
+}
 #endif
 
 /********************************************************/
diff -Nur tcc-0.9.26.orig/libtcc.h tcc-0.9.26/libtcc.h
--- tcc-0.9.26.orig/libtcc.h	2013-02-15 15:24:00.000000000 +0100
+++ tcc-0.9.26/libtcc.h	2013-11-03 08:29:45.000000000 +0100
@@ -16,6 +16,11 @@
 /* create a new TCC compilation context */
 LIBTCCAPI TCCState *tcc_new(void);
 
+#ifdef _WIN32
+/* when libtcc linked to DLL, use this from DllMain() */
+LIBTCCAPI void tcc_set_lib_path_mod(TCCState *s, void *module_handle);
+#endif
+
 /* free a TCC compilation context */
 LIBTCCAPI void tcc_delete(TCCState *s);
 
diff -Nur tcc-0.9.26.orig/Makefile tcc-0.9.26/Makefile
--- tcc-0.9.26.orig/Makefile	2013-02-15 15:24:00.000000000 +0100
+++ tcc-0.9.26/Makefile	2013-11-03 08:29:45.000000000 +0100
@@ -218,84 +218,84 @@
 
 ifndef CONFIG_WIN32
 install: $(PROGS) $(TCCLIBS) $(TCCDOCS)
-	mkdir -p "$(bindir)"
+	mkdir -p "$(DESTDIR)/$(bindir)"
 ifeq ($(CC),tcc)
-	$(INSTALL) -m755 $(PROGS) "$(bindir)"
+	$(INSTALL) -m755 $(PROGS) "$(DESTDIR)/$(bindir)"
 else
-	$(INSTALLBIN) -m755 $(PROGS) "$(bindir)"
+	$(INSTALLBIN) -m755 $(PROGS) "$(DESTDIR)/$(bindir)"
 endif
-	mkdir -p "$(mandir)/man1"
-	-$(INSTALL) tcc.1 "$(mandir)/man1"
-	mkdir -p "$(infodir)"
-	-$(INSTALL) tcc-doc.info "$(infodir)"
-	mkdir -p "$(tccdir)"
-	mkdir -p "$(tccdir)/include"
+	mkdir -p "$(DESTDIR)/$(mandir)/man1"
+	-$(INSTALL) tcc.1 "$(DESTDIR)/$(mandir)/man1"
+	mkdir -p "$(DESTDIR)/$(infodir)"
+	-$(INSTALL) tcc-doc.info "$(DESTDIR)/$(infodir)"
+	mkdir -p "$(DESTDIR)/$(tccdir)"
+	mkdir -p "$(DESTDIR)/$(tccdir)/include"
 ifneq ($(LIBTCC1),)
-	$(INSTALL) -m644 $(LIBTCC1) "$(tccdir)"
+	$(INSTALL) -m644 $(LIBTCC1) "$(DESTDIR)/$(tccdir)"
 endif
-	$(INSTALL) -m644 $(addprefix $(top_srcdir)/include/,$(TCC_INCLUDES)) "$(tccdir)/include"
-	mkdir -p "$(libdir)"
-	$(INSTALL) -m755 $(LIBTCC) "$(libdir)"
+	$(INSTALL) -m644 $(addprefix $(top_srcdir)/include/,$(TCC_INCLUDES)) "$(DESTDIR)/$(tccdir)/include"
+	mkdir -p "$(DESTDIR)/$(libdir)"
+	$(INSTALL) -m755 $(LIBTCC) "$(DESTDIR)/$(libdir)"
 ifdef DISABLE_STATIC
-	ln -sf "$(ln_libdir)/libtcc.so.1.0" "$(libdir)/libtcc.so.1"
-	ln -sf "$(ln_libdir)/libtcc.so.1.0" "$(libdir)/libtcc.so"
+	ln -sf "$(ln_libdir)/libtcc.so.1.0" "$(DESTDIR)/$(libdir)/libtcc.so.1"
+	ln -sf "$(ln_libdir)/libtcc.so.1.0" "$(DESTDIR)/$(libdir)/libtcc.so"
 endif
 	mkdir -p "$(includedir)"
-	$(INSTALL) -m644 $(top_srcdir)/libtcc.h "$(includedir)"
-	mkdir -p "$(docdir)"
-	-$(INSTALL) -m644 tcc-doc.html "$(docdir)"
+	$(INSTALL) -m644 $(top_srcdir)/libtcc.h "$(DESTDIR)/$(includedir)"
+	mkdir -p "$(DESTDIR)/$(docdir)"
+	-$(INSTALL) -m644 tcc-doc.html "$(DESTDIR)/$(docdir)"
 ifdef CONFIG_CROSS
-	mkdir -p "$(tccdir)/win32/lib/32"
-	mkdir -p "$(tccdir)/win32/lib/64"
+	mkdir -p "$(DESTDIR)/$(tccdir)/win32/lib/32"
+	mkdir -p "$(DESTDIR)/$(tccdir)/win32/lib/64"
 ifeq ($(ARCH),x86-64)
-	mkdir -p "$(tccdir)/i386"
-	$(INSTALL) -m644 lib/i386/libtcc1.a "$(tccdir)/i386"
-	cp -r "$(tccdir)/include" "$(tccdir)/i386"
-endif
-	$(INSTALL) -m644 win32/lib/*.def "$(tccdir)/win32/lib"
-	$(INSTALL) -m644 lib/i386-win32/libtcc1.a "$(tccdir)/win32/lib/32"
-	$(INSTALL) -m644 lib/x86_64-win32/libtcc1.a "$(tccdir)/win32/lib/64"
-	cp -r win32/include/. "$(tccdir)/win32/include"
-	cp -r include/. "$(tccdir)/win32/include"
+	mkdir -p "$(DESTDIR)/$(tccdir)/i386"
+	$(INSTALL) -m644 lib/i386/libtcc1.a "$(DESTDIR)/$(tccdir)/i386"
+	cp -r "$(tccdir)/include" "$(DESTDIR)/$(tccdir)/i386"
+endif
+	$(INSTALL) -m644 win32/lib/*.def "$(DESTDIR)/$(tccdir)/win32/lib"
+	$(INSTALL) -m644 lib/i386-win32/libtcc1.a "$(DESTDIR)/$(tccdir)/win32/lib/32"
+	$(INSTALL) -m644 lib/x86_64-win32/libtcc1.a "$(DESTDIR)/$(tccdir)/win32/lib/64"
+	cp -r win32/include/. "$(DESTDIR)/$(tccdir)/win32/include"
+	cp -r include/. "$(DESTDIR)/$(tccdir)/win32/include"
 endif
 
 uninstall:
-	rm -fv $(foreach P,$(PROGS),"$(bindir)/$P")
-	rm -fv $(foreach P,$(LIBTCC1),"$(tccdir)/$P")
-	rm -fv $(foreach P,$(TCC_INCLUDES),"$(tccdir)/include/$P")
-	rm -fv "$(docdir)/tcc-doc.html" "$(mandir)/man1/tcc.1" "$(infodir)/tcc-doc.info"
-	rm -fv "$(libdir)/$(LIBTCC)" "$(includedir)/libtcc.h"
-	rm -fv "$(libdir)/libtcc.so*"
-	rm -rf "$(tccdir)/win32"
-	-rmdir $(tccdir)/include
+	rm -fv $(foreach P,$(PROGS),"$(DESTDIR)/$(bindir)/$P")
+	rm -fv $(foreach P,$(LIBTCC1),"$(DESTDIR)/$(tccdir)/$P")
+	rm -fv $(foreach P,$(TCC_INCLUDES),"$(DESTDIR)/$(tccdir)/include/$P")
+	rm -fv "$(DESTDIR)/$(docdir)/tcc-doc.html" "$(DESTDIR)/$(mandir)/man1/tcc.1" "$(DESTDIR)/$(infodir)/tcc-doc.info"
+	rm -fv "$(DESTDIR)/$(libdir)/$(LIBTCC)" "$(DESTDIR)/$(includedir)/libtcc.h"
+	rm -fv "$(DESTDIR)/$(libdir)/libtcc.so*"
+	rm -rf "$(DESTDIR)/$(tccdir)/win32"
+	-rmdir $(DESTDIR)/$(tccdir)/include
 ifeq ($(ARCH),x86-64)
-	rm -rf "$(tccdir)/i386"
+	rm -rf "$(DESTDIR)/$(tccdir)/i386"
 endif
 else
 # on windows
 install: $(PROGS) $(TCCLIBS) $(TCCDOCS)
-	mkdir -p "$(tccdir)"
-	mkdir -p "$(tccdir)/lib"
-	mkdir -p "$(tccdir)/include"
-	mkdir -p "$(tccdir)/examples"
-	mkdir -p "$(tccdir)/doc"
-	mkdir -p "$(tccdir)/libtcc"
-	$(INSTALLBIN) -m755 $(PROGS) "$(tccdir)"
-	$(INSTALL) -m644 $(LIBTCC1) win32/lib/*.def "$(tccdir)/lib"
-	cp -r win32/include/. "$(tccdir)/include"
-	cp -r win32/examples/. "$(tccdir)/examples"
-	$(INSTALL) -m644 $(addprefix include/,$(TCC_INCLUDES)) "$(tccdir)/include"
-	$(INSTALL) -m644 tcc-doc.html win32/tcc-win32.txt "$(tccdir)/doc"
-	$(INSTALL) -m644 $(LIBTCC) libtcc.h "$(tccdir)/libtcc"
+	mkdir -p "$(DESTDIR)/$(tccdir)"
+	mkdir -p "$(DESTDIR)/$(tccdir)/lib"
+	mkdir -p "$(DESTDIR)/$(tccdir)/include"
+	mkdir -p "$(DESTDIR)/$(tccdir)/examples"
+	mkdir -p "$(DESTDIR)/$(tccdir)/doc"
+	mkdir -p "$(DESTDIR)/$(tccdir)/libtcc"
+	$(INSTALLBIN) -m755 $(PROGS) "$(DESTDIR)/$(tccdir)"
+	$(INSTALL) -m644 $(LIBTCC1) win32/lib/*.def "$(DESTDIR)/$(tccdir)/lib"
+	cp -r win32/include/. "$(DESTDIR)/$(tccdir)/include"
+	cp -r win32/examples/. "$(DESTDIR)/$(tccdir)/examples"
+	$(INSTALL) -m644 $(addprefix include/,$(TCC_INCLUDES)) "$(DESTDIR)/$(tccdir)/include"
+	$(INSTALL) -m644 tcc-doc.html win32/tcc-win32.txt "$(DESTDIR)/$(tccdir)/doc"
+	$(INSTALL) -m644 $(LIBTCC) libtcc.h "$(DESTDIR)/$(tccdir)/libtcc"
 ifdef CONFIG_CROSS
-	mkdir -p "$(tccdir)/lib/32"
-	mkdir -p "$(tccdir)/lib/64"
-	-$(INSTALL) -m644 lib/i386-win32/libtcc1.a "$(tccdir)/lib/32"
-	-$(INSTALL) -m644 lib/x86_64-win32/libtcc1.a "$(tccdir)/lib/64"
+	mkdir -p "$(DESTDIR)/$(tccdir)/lib/32"
+	mkdir -p "$(DESTDIR)/$(tccdir)/lib/64"
+	-$(INSTALL) -m644 lib/i386-win32/libtcc1.a "$(DESTDIR)/$(tccdir)/lib/32"
+	-$(INSTALL) -m644 lib/x86_64-win32/libtcc1.a "$(DESTDIR)/$(tccdir)/lib/64"
 endif
 
 uninstall:
-	rm -rfv "$(tccdir)/*"
+	rm -rfv "$(DESTDIR)/$(tccdir)/*"
 endif
 
 # documentation and man page
diff -Nur tcc-0.9.26.orig/mingw-cross-build.sh tcc-0.9.26/mingw-cross-build.sh
--- tcc-0.9.26.orig/mingw-cross-build.sh	1970-01-01 01:00:00.000000000 +0100
+++ tcc-0.9.26/mingw-cross-build.sh	2013-11-03 08:55:28.000000000 +0100
@@ -0,0 +1,20 @@
+#!/bin/sh
+#
+# Build script for cross compiling TCC for Win32
+# for integration into SQLite ODBC driver.
+# Tested on Fedora Core 3 and 5.
+#
+# Cross toolchain and NSIS for Linux/i386/x86_64 can be fetched from
+#  http://www.ch-werner.de/xtools/crossmingw64-0.3-1.i386.rpm
+#  http://www.ch-werner.de/xtools/crossmingw64-0.3.i386.tar.bz2
+#  http://www.ch-werner.de/xtools/crossmingw64-0.3-1.x86_64.rpm
+#  http://www.ch-werner.de/xtools/crossmingw64-0.3.x86_64.tar.bz2
+#  http://www.ch-werner.de/xtools/nsis-2.37-1.i386.rpm
+
+set -e
+
+rm -rf ../TCC
+sh cross-configure.sh --prefix=/TCC --enable-mingw32 --extra-cflags="-m32 -march=i386 -mtune=i386"
+sh cross-make.sh clean all
+sh cross-make.sh DESTDIR=.. install
+sh cross-make.sh distclean
diff -Nur tcc-0.9.26.orig/tccpp.c tcc-0.9.26/tccpp.c
--- tcc-0.9.26.orig/tccpp.c	2013-02-15 15:24:00.000000000 +0100
+++ tcc-0.9.26/tccpp.c	2013-11-03 08:29:45.000000000 +0100
@@ -274,8 +274,8 @@
     case TOK_CLLONG:
     case TOK_CULLONG:
         /* XXX: not quite exact, but only useful for testing  */
-#ifdef _WIN32
-        sprintf(p, "%u", (unsigned)cv->ull);
+#if defined(_WIN32) || defined(_WIN64)
+        sprintf(p, "%I64u", cv->ull);
 #else
         sprintf(p, "%Lu", cv->ull);
 #endif
diff -Nur tcc-0.9.26.orig/win32/include/odbcinst.h tcc-0.9.26/win32/include/odbcinst.h
--- tcc-0.9.26.orig/win32/include/odbcinst.h	1970-01-01 01:00:00.000000000 +0100
+++ tcc-0.9.26/win32/include/odbcinst.h	2013-11-03 08:29:45.000000000 +0100
@@ -0,0 +1,148 @@
+#ifndef _ODBCINST_H
+#define _ODBCINST_H
+#if __GNUC__ >=3
+#pragma GCC system_header
+#endif
+#include <sql.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+#ifndef ODBCVER
+#define ODBCVER 0x0351
+#endif
+#define INSTAPI __stdcall
+#define  ODBC_ADD_DSN     1
+#define  ODBC_CONFIG_DSN  2
+#define  ODBC_REMOVE_DSN  3
+#if (ODBCVER >= 0x0250)
+#define ODBC_ADD_SYS_DSN 4
+#define ODBC_CONFIG_SYS_DSN 5
+#define ODBC_REMOVE_SYS_DSN 6
+#define ODBC_INSTALL_INQUIRY 1 
+#define ODBC_INSTALL_COMPLETE 2
+#define ODBC_INSTALL_DRIVER 1
+#define ODBC_REMOVE_DRIVER 2
+#define ODBC_CONFIG_DRIVER 3
+#define ODBC_CONFIG_DRIVER_MAX 100
+#endif /* (ODBCVER >= 0x0250) */
+#if (ODBCVER >= 0x0300)
+#define ODBC_REMOVE_DEFAULT_DSN 7
+#define ODBC_BOTH_DSN 0
+#define ODBC_USER_DSN 1
+#define ODBC_SYSTEM_DSN 2
+#define ODBC_ERROR_GENERAL_ERR 1
+#define ODBC_ERROR_INVALID_BUFF_LEN 2
+#define ODBC_ERROR_INVALID_HWND 3
+#define ODBC_ERROR_INVALID_STR 4
+#define ODBC_ERROR_INVALID_REQUEST_TYPE 5
+#define ODBC_ERROR_COMPONENT_NOT_FOUND 6
+#define ODBC_ERROR_INVALID_NAME 7
+#define ODBC_ERROR_INVALID_KEYWORD_VALUE 8
+#define ODBC_ERROR_INVALID_DSN 9
+#define ODBC_ERROR_INVALID_INF 10
+#define ODBC_ERROR_REQUEST_FAILED 11
+#define ODBC_ERROR_INVALID_PATH 12
+#define ODBC_ERROR_LOAD_LIB_FAILED 13
+#define ODBC_ERROR_INVALID_PARAM_SEQUENCE 14
+#define ODBC_ERROR_INVALID_LOG_FILE 15
+#define ODBC_ERROR_USER_CANCELED 16
+#define ODBC_ERROR_USAGE_UPDATE_FAILED 17
+#define ODBC_ERROR_CREATE_DSN_FAILED 18
+#define ODBC_ERROR_WRITING_SYSINFO_FAILED 19
+#define ODBC_ERROR_REMOVE_DSN_FAILED 20
+#define ODBC_ERROR_OUT_OF_MEM 21
+#define ODBC_ERROR_OUTPUT_STRING_TRUNCATED 22
+#endif /* ODBCVER >= 0x0300 */
+
+#ifndef RC_INVOKED
+BOOL INSTAPI ConfigDSN(HWND,WORD,LPCSTR,LPCSTR);
+BOOL INSTAPI ConfigDSNW(HWND,WORD,LPCWSTR,LPCWSTR);
+BOOL INSTAPI ConfigTranslator(HWND,DWORD*);
+BOOL INSTAPI SQLConfigDataSource(HWND,WORD,LPCSTR,LPCSTR);
+BOOL INSTAPI SQLConfigDataSourceW(HWND,WORD,LPCWSTR,LPCWSTR);
+BOOL INSTAPI SQLCreateDataSource(HWND,LPCSTR);
+BOOL INSTAPI SQLCreateDataSourceW(HWND,LPCWSTR);
+BOOL INSTAPI SQLGetAvailableDrivers(LPCSTR,LPSTR,WORD,WORD*);
+BOOL INSTAPI SQLGetAvailableDriversW(LPCWSTR,LPWSTR,WORD,WORD*);
+BOOL INSTAPI SQLGetInstalledDrivers(LPSTR,WORD,WORD*);
+BOOL INSTAPI SQLGetInstalledDriversW(LPWSTR,WORD,WORD*);
+int INSTAPI SQLGetPrivateProfileString(LPCSTR,LPCSTR,LPCSTR,LPSTR,int,LPCSTR);
+int INSTAPI SQLGetPrivateProfileStringW(LPCWSTR,LPCWSTR,LPCWSTR,LPWSTR,int,LPCWSTR);
+BOOL INSTAPI SQLGetTranslator(HWND,LPSTR,WORD,WORD*,LPSTR,WORD,WORD*,DWORD*);
+BOOL INSTAPI SQLGetTranslatorW(HWND,LPWSTR,WORD,WORD*,LPWSTR,WORD,WORD*,DWORD*);
+BOOL INSTAPI SQLInstallDriver(LPCSTR,LPCSTR,LPSTR,WORD,WORD*);
+BOOL INSTAPI SQLInstallDriverManager(LPSTR,WORD,WORD*);
+BOOL INSTAPI SQLInstallDriverManagerW(LPWSTR,WORD,WORD*);
+BOOL INSTAPI SQLInstallDriverW(LPCWSTR,LPCWSTR,LPWSTR,WORD,WORD*);
+BOOL INSTAPI SQLInstallODBC(HWND,LPCSTR,LPCSTR,LPCSTR);
+BOOL INSTAPI SQLInstallODBCW(HWND,LPCWSTR,LPCWSTR,LPCWSTR);
+BOOL INSTAPI SQLManageDataSources(HWND);
+BOOL INSTAPI SQLRemoveDefaultDataSource(void);
+BOOL INSTAPI SQLRemoveDSNFromIni(LPCSTR);
+BOOL INSTAPI SQLRemoveDSNFromIniW(LPCWSTR);
+BOOL INSTAPI SQLValidDSN(LPCSTR);
+BOOL INSTAPI SQLValidDSNW(LPCWSTR);
+BOOL INSTAPI SQLWriteDSNToIni(LPCSTR,LPCSTR);
+BOOL INSTAPI SQLWriteDSNToIniW(LPCWSTR,LPCWSTR);
+BOOL INSTAPI SQLWritePrivateProfileString(LPCSTR,LPCSTR,LPCSTR,LPCSTR);
+BOOL INSTAPI SQLWritePrivateProfileStringW(LPCWSTR,LPCWSTR,LPCWSTR,LPCWSTR);
+#if(ODBCVER >= 0x0250) 
+BOOL INSTAPI ConfigDriver(HWND,WORD,LPCSTR,LPCSTR,LPSTR,WORD,WORD*);
+BOOL INSTAPI ConfigDriverW(HWND,WORD,LPCWSTR,LPCWSTR,LPWSTR,WORD,WORD*);
+BOOL INSTAPI SQLConfigDriver(HWND,WORD,LPCSTR,LPCSTR,LPSTR,WORD,WORD*);
+BOOL INSTAPI SQLConfigDriverW(HWND,WORD,LPCWSTR,LPCWSTR,LPWSTR,WORD,WORD*);
+BOOL INSTAPI SQLInstallTranslator(LPCSTR,LPCSTR,LPCSTR,LPSTR,WORD,WORD*,WORD,LPDWORD);
+BOOL INSTAPI SQLInstallTranslatorW(LPCWSTR,LPCWSTR,LPCWSTR,LPWSTR,WORD,WORD*,WORD,LPDWORD);
+BOOL INSTAPI SQLRemoveDriver(LPCSTR,BOOL,LPDWORD);
+BOOL INSTAPI SQLRemoveDriverManager(LPDWORD);
+BOOL INSTAPI SQLRemoveDriverW(LPCWSTR,BOOL,LPDWORD);
+BOOL INSTAPI SQLRemoveTranslator(LPCSTR,LPDWORD);
+BOOL INSTAPI SQLRemoveTranslatorW(LPCWSTR,LPDWORD);
+#endif /* ODBCVER >= 0x0250 */  
+#if (ODBCVER >= 0x0300) 
+BOOL INSTAPI SQLGetConfigMode(UWORD*);
+BOOL INSTAPI SQLInstallDriverEx(LPCSTR,LPCSTR,LPSTR,WORD,WORD*,WORD,LPDWORD);
+BOOL INSTAPI SQLInstallDriverExW(LPCWSTR,LPCWSTR,LPWSTR,WORD,WORD*,WORD,LPDWORD);
+SQLRETURN INSTAPI SQLInstallerError(WORD,DWORD*,LPSTR,WORD,WORD*);
+SQLRETURN INSTAPI SQLInstallerErrorW(WORD,DWORD*,LPWSTR,WORD,WORD*);
+BOOL INSTAPI SQLInstallTranslatorEx(LPCSTR,LPCSTR,LPSTR,WORD,WORD*,WORD,LPDWORD);
+BOOL INSTAPI SQLInstallTranslatorExW(LPCWSTR,LPCWSTR,LPWSTR,WORD,WORD*,WORD,LPDWORD);
+SQLRETURN INSTAPI SQLPostInstallerError(DWORD,LPCSTR);
+SQLRETURN INSTAPI SQLPostInstallerErrorW(DWORD,LPCWSTR);
+BOOL INSTAPI SQLReadFileDSN(LPCSTR,LPCSTR,LPCSTR,LPSTR,WORD,WORD*);
+BOOL INSTAPI SQLReadFileDSNW(LPCWSTR,LPCWSTR,LPCWSTR,LPWSTR,WORD,WORD*);
+BOOL INSTAPI SQLSetConfigMode(UWORD);
+BOOL INSTAPI SQLWriteFileDSN(LPCSTR,LPCSTR,LPCSTR,LPCSTR);
+BOOL INSTAPI SQLWriteFileDSNW(LPCWSTR,LPCWSTR,LPCWSTR,LPCWSTR);
+#endif /* ODBCVER >= 0x0300 */  
+
+#if defined (UNICODE) && !defined (SQL_NOUNICODEMAP)
+#define SQLConfigDataSource SQLConfigDataSourceW
+#define SQLConfigDriver SQLConfigDriverW
+#define SQLCreateDataSource SQLCreateDataSourceW 
+#define SQLGetAvailableDrivers SQLGetAvailableDriversW 
+#define SQLGetInstalledDrivers SQLGetInstalledDriversW
+#define SQLGetPrivateProfileString SQLGetPrivateProfileStringW
+#define SQLGetTranslator SQLGetTranslatorW 
+#define SQLInstallDriver SQLInstallDriverW 
+#define SQLInstallDriverEx SQLInstallDriverExW
+#define SQLInstallDriverManager SQLInstallDriverManagerW
+#define SQLInstallerError SQLInstallerErrorW
+#define SQLInstallODBC SQLInstallODBCW 
+#define SQLInstallTranslator SQLInstallTranslatorW
+#define SQLInstallTranslatorEx SQLInstallTranslatorExW
+#define SQLPostInstallerError SQLPostInstallerErrorW
+#define SQLReadFileDSN SQLReadFileDSNW
+#define SQLRemoveDriver SQLRemoveDriverW
+#define SQLRemoveDSNFromIni SQLRemoveDSNFromIniW 
+#define SQLRemoveTranslator SQLRemoveTranslatorW
+#define SQLValidDSN SQLValidDSNW 
+#define SQLWriteDSNToIni SQLWriteDSNToIniW 
+#define SQLWriteFileDSN SQLWriteFileDSNW
+#define SQLWritePrivateProfileString SQLWritePrivateProfileStringW
+#endif /* UNICODE && !SQL_NOUNICODEMAP */
+#endif /* RC_INVOKED */
+#ifdef __cplusplus
+}
+#endif
+#endif /* _ODBCINST_H */
diff -Nur tcc-0.9.26.orig/win32/include/sqlext.h tcc-0.9.26/win32/include/sqlext.h
--- tcc-0.9.26.orig/win32/include/sqlext.h	1970-01-01 01:00:00.000000000 +0100
+++ tcc-0.9.26/win32/include/sqlext.h	2013-11-03 08:29:45.000000000 +0100
@@ -0,0 +1,1218 @@
+#ifndef _SQLEXT_H
+#define _SQLEXT_H
+#if __GNUC__ >=3
+#pragma GCC system_header
+#endif
+
+#include <sql.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+#define SQL_SPEC_MAJOR 3
+#define SQL_SPEC_MINOR	51
+#define SQL_SPEC_STRING "03.51"
+#define SQL_ACCESS_MODE 101
+#define SQL_ACTIVE_CONNECTIONS 0
+#define SQL_ACTIVE_STATEMENTS 1
+#define SQL_ADD 4
+#define SQL_ALL_EXCEPT_LIKE 2
+#define SQL_API_ALL_FUNCTIONS 0
+#define SQL_API_LOADBYORDINAL 199
+#define SQL_API_SQLBINDPARAMETER 72
+#define SQL_API_SQLBROWSECONNECT 55
+#define SQL_API_SQLCOLATTRIBUTES 6
+#define SQL_API_SQLCOLUMNPRIVILEGES 56
+#define SQL_API_SQLDESCRIBEPARAM 58
+#define SQL_API_SQLDRIVERCONNECT 41
+#define SQL_API_SQLDRIVERS 71
+#define SQL_API_SQLEXTENDEDFETCH 59
+#define SQL_API_SQLFOREIGNKEYS 60
+#define SQL_API_SQLMORERESULTS 61
+#define SQL_API_SQLNATIVESQL 62
+#define SQL_API_SQLNUMPARAMS 63
+#define SQL_API_SQLPARAMOPTIONS 64
+#define SQL_API_SQLPRIMARYKEYS 65
+#define SQL_API_SQLPROCEDURECOLUMNS 66
+#define SQL_API_SQLPROCEDURES 67
+#define SQL_API_SQLSETPOS 68
+#define SQL_API_SQLSETSCROLLOPTIONS 69
+#define SQL_API_SQLTABLEPRIVILEGES 70
+#define SQL_ASYNC_ENABLE 4
+#define SQL_ASYNC_ENABLE_DEFAULT SQL_ASYNC_ENABLE_OFF
+#define SQL_ASYNC_ENABLE_OFF 0UL
+#define SQL_ASYNC_ENABLE_ON 1UL
+#define SQL_ATTR_CONNECTION_DEAD 1209
+#define SQL_ATTR_READONLY 0
+#define SQL_ATTR_READWRITE_UNKNOWN 2
+#define SQL_ATTR_WRITE 1
+#define SQL_AUTOCOMMIT 102
+#define SQL_AUTOCOMMIT_DEFAULT SQL_AUTOCOMMIT_ON
+#define SQL_AUTOCOMMIT_OFF 0UL
+#define SQL_AUTOCOMMIT_ON 1UL
+#define SQL_BEST_ROWID 1
+#define SQL_BIGINT (-5)
+#define SQL_BINARY (-2)
+#define SQL_BIND_BY_COLUMN 0UL
+#define SQL_BIND_TYPE 5
+#define SQL_BIND_TYPE_DEFAULT SQL_BIND_BY_COLUMN
+#define SQL_BIT (-7)
+#define SQL_BOOKMARK_PERSISTENCE 82
+#define SQL_BP_CLOSE 1
+#define SQL_BP_DELETE 2
+#define SQL_BP_DROP 4
+#define SQL_BP_OTHER_HSTMT 32
+#define SQL_BP_SCROLL 64
+#define SQL_BP_TRANSACTION 8
+#define SQL_BP_UPDATE 16
+#define SQL_C_BINARY SQL_BINARY
+#define SQL_C_BIT SQL_BIT
+#define SQL_C_BOOKMARK SQL_C_ULONG
+#define SQL_C_CHAR SQL_CHAR
+#define SQL_C_DATE SQL_DATE
+#define SQL_C_DEFAULT 99
+#define SQL_C_DOUBLE SQL_DOUBLE
+#define SQL_C_FLOAT SQL_REAL
+#define SQL_C_LONG SQL_INTEGER
+#define SQL_C_SHORT SQL_SMALLINT
+#define SQL_C_SLONG (SQL_C_LONG+SQL_SIGNED_OFFSET)
+#define SQL_C_SSHORT (SQL_C_SHORT+SQL_SIGNED_OFFSET)
+#define SQL_C_STINYINT (SQL_TINYINT+SQL_SIGNED_OFFSET)
+#define SQL_C_TIME SQL_TIME
+#define SQL_C_TIMESTAMP SQL_TIMESTAMP
+#define SQL_C_TINYINT SQL_TINYINT
+#define SQL_C_ULONG (SQL_C_LONG+SQL_UNSIGNED_OFFSET)
+#define SQL_C_USHORT (SQL_C_SHORT+SQL_UNSIGNED_OFFSET)
+#define SQL_C_UTINYINT (SQL_TINYINT+SQL_UNSIGNED_OFFSET)
+#define SQL_CASCADE 0
+#define SQL_CB_NON_NULL 1
+#define SQL_CB_NULL 0
+#define SQL_CC_CLOSE SQL_CB_CLOSE /* deprecated */
+#define SQL_CC_DELETE SQL_CB_DELETE /* deprecated */
+#define SQL_CC_PRESERVE SQL_CB_PRESERVE /* deprecated */
+#define SQL_CD_FALSE 0L
+#define SQL_CD_TRUE 1L
+#define SQL_CN_ANY 2
+#define SQL_CN_DIFFERENT 1
+#define SQL_CN_NONE 0
+#define SQL_COLATT_OPT_MAX SQL_COLUMN_LABEL
+#define SQL_COLATT_OPT_MIN SQL_COLUMN_COUNT
+#define SQL_COLUMN_ALIAS 87
+#define SQL_COLUMN_AUTO_INCREMENT 11
+#define SQL_COLUMN_CASE_SENSITIVE 12
+#define SQL_COLUMN_COUNT 0
+#define SQL_COLUMN_DISPLAY_SIZE 6
+#define SQL_COLUMN_LABEL 18
+#define SQL_COLUMN_LENGTH 3
+#define SQL_COLUMN_MONEY 9
+#define SQL_COLUMN_NAME 1
+#define SQL_COLUMN_NULLABLE 7
+#define SQL_COLUMN_OWNER_NAME 16
+#define SQL_COLUMN_PRECISION 4
+#define SQL_COLUMN_QUALIFIER_NAME 17
+#define SQL_COLUMN_SCALE 5
+#define SQL_COLUMN_SEARCHABLE 13
+#define SQL_COLUMN_TABLE_NAME 15
+#define SQL_COLUMN_TYPE 2
+#define SQL_COLUMN_TYPE_NAME 14
+#define SQL_COLUMN_UNSIGNED 8
+#define SQL_COLUMN_UPDATABLE 10
+#define SQL_CONCAT_NULL_BEHAVIOR 22
+#define SQL_CONCUR_DEFAULT SQL_CONCUR_READ_ONLY
+#define SQL_CONCUR_LOCK 2
+#define SQL_CONCUR_READ_ONLY 1
+#define SQL_CONCUR_ROWVER 3
+#define SQL_CONCUR_TIMESTAMP SQL_CONCUR_ROWVER /* deprecated */
+#define SQL_CONCUR_VALUES 4
+#define SQL_CONCURRENCY 7
+#define SQL_CONVERT_BIGINT 53
+#define SQL_CONVERT_BINARY 54
+#define SQL_CONVERT_BIT 55
+#define SQL_CONVERT_CHAR 56
+#define SQL_CONVERT_DATE 57
+#define SQL_CONVERT_DECIMAL 58
+#define SQL_CONVERT_DOUBLE 59
+#define SQL_CONVERT_FLOAT 60
+#define SQL_CONVERT_FUNCTIONS 48
+#define SQL_CONVERT_INTEGER 61
+#define SQL_CONVERT_LONGVARBINARY 71
+#define SQL_CONVERT_LONGVARCHAR 62
+#define SQL_CONVERT_NUMERIC 63
+#define SQL_CONVERT_REAL 64
+#define SQL_CONVERT_SMALLINT 65
+#define SQL_CONVERT_TIME 66
+#define SQL_CONVERT_TIMESTAMP 67
+#define SQL_CONVERT_TINYINT 68
+#define SQL_CONVERT_VARBINARY 69
+#define SQL_CONVERT_VARCHAR 70
+#define SQL_CORRELATION_NAME 74
+#define SQL_CR_CLOSE SQL_CB_CLOSE /* deprecated */
+#define SQL_CR_DELETE SQL_CB_DELETE /* deprecated */
+#define SQL_CR_PRESERVE SQL_CB_PRESERVE /* deprecated */
+#define SQL_CUR_DEFAULT SQL_CUR_USE_DRIVER
+#define SQL_CUR_USE_DRIVER 2UL
+#define SQL_CUR_USE_IF_NEEDED 0UL
+#define SQL_CUR_USE_ODBC 1UL
+#define SQL_CURRENT_QUALIFIER 109
+#define SQL_CURSOR_DYNAMIC 2UL
+#define SQL_CURSOR_FORWARD_ONLY 0UL
+#define SQL_CURSOR_KEYSET_DRIVEN 1UL
+#define SQL_CURSOR_ROLLBACK_BEHAVIOR 24
+#define SQL_CURSOR_STATIC 3UL
+#define SQL_CURSOR_TYPE 6
+#define SQL_CURSOR_TYPE_DEFAULT SQL_CURSOR_FORWARD_ONLY
+#define SQL_CV_CASCADED 0x00000004L
+#define SQL_CV_CHECK_OPTION 0x00000002L
+#define SQL_CV_CREATE_VIEW 0x00000001L
+#define SQL_CV_LOCAL 0x00000008L
+#define SQL_CVT_BIGINT 0x00004000L
+#define SQL_CVT_BINARY 0x00000400L
+#define SQL_CVT_BIT 0x00001000L
+#define SQL_CVT_CHAR 0x00000001L
+#define SQL_CVT_DATE 0x00008000L
+#define SQL_CVT_DECIMAL 0x00000004L
+#define SQL_CVT_DOUBLE 0x00000080L
+#define SQL_CVT_FLOAT 0x00000020L
+#define SQL_CVT_INTEGER 0x00000008L
+#define SQL_CVT_LONGVARBINARY 0x00040000L
+#define SQL_CVT_LONGVARCHAR 0x00000200L
+#define SQL_CVT_NUMERIC 0x00000002L
+#define SQL_CVT_REAL 0x00000040L
+#define SQL_CVT_SMALLINT 0x00000010L
+#define SQL_CVT_TIME 0x00010000L
+#define SQL_CVT_TIMESTAMP 0x00020000L
+#define SQL_CVT_TINYINT 0x00002000L
+#define SQL_CVT_VARBINARY 0x00000800L
+#define SQL_CVT_VARCHAR 0x00000100L
+#define SQL_DATABASE_NAME 16 /* deprecated */
+#define SQL_DATE 9
+#define SQL_DEFAULT_PARAM (-5)
+#define SQL_DELETE 3
+#define SQL_DRIVER_COMPLETE 1
+#define SQL_DRIVER_COMPLETE_REQUIRED 3
+#define SQL_DRIVER_HDBC 3
+#define SQL_DRIVER_HENV 4
+#define SQL_DRIVER_HLIB 76
+#define SQL_DRIVER_HSTMT 5
+#define SQL_DRIVER_NAME 6
+#define SQL_DRIVER_NOPROMPT 0
+#define SQL_DRIVER_ODBC_VER 77
+#define SQL_DRIVER_PROMPT 2
+#define SQL_DRIVER_VER 7
+#define SQL_DTC_ENLIST_EXPENSIVE 1
+#define SQL_DTC_TRANSITION_COST 1750
+#define SQL_DTC_UNENLIST_EXPENSIVE 2
+#define SQL_ENSURE 1
+#define SQL_ENTIRE_ROWSET 0
+#define SQL_EXPRESSIONS_IN_ORDERBY 27
+#define SQL_FD_FETCH_BOOKMARK 128
+#define SQL_FD_FETCH_PREV SQL_FD_FETCH_PRIOR /* deprecated */
+#define SQL_FD_FETCH_RESUME 64
+#define SQL_FETCH_BOOKMARK 8
+#define SQL_FETCH_PREV SQL_FETCH_PRIOR /* deprecated */
+#define SQL_FETCH_RESUME 7 /* deprecated */
+#define SQL_FILE_CATALOG SQL_FILE_QUALIFIER
+#define SQL_FILE_NOT_SUPPORTED 0x0000
+#define SQL_FILE_QUALIFIER 0x0002
+#define SQL_FILE_TABLE 0x0001
+#define SQL_FILE_USAGE 84
+#define SQL_FN_CVT_CONVERT 0x00000001L
+#define SQL_FN_NUM_ABS 0x00000001L
+#define SQL_FN_NUM_ACOS 0x00000002L
+#define SQL_FN_NUM_ASIN 0x00000004L
+#define SQL_FN_NUM_ATAN 0x00000008L
+#define SQL_FN_NUM_ATAN2 0x00000010L
+#define SQL_FN_NUM_CEILING 0x00000020L
+#define SQL_FN_NUM_COS 0x00000040L
+#define SQL_FN_NUM_COT 0x00000080L
+#define SQL_FN_NUM_DEGREES 0x00040000L
+#define SQL_FN_NUM_EXP 0x00000100L
+#define SQL_FN_NUM_FLOOR 0x00000200L
+#define SQL_FN_NUM_LOG 0x00000400L
+#define SQL_FN_NUM_LOG10 0x00080000L
+#define SQL_FN_NUM_MOD 0x00000800L
+#define SQL_FN_NUM_PI 0x00010000L
+#define SQL_FN_NUM_POWER 0x00100000L
+#define SQL_FN_NUM_RADIANS 0x00200000L
+#define SQL_FN_NUM_RAND 0x00020000L
+#define SQL_FN_NUM_ROUND 0x00400000L
+#define SQL_FN_NUM_SIGN 0x00001000L
+#define SQL_FN_NUM_SIN 0x00002000L
+#define SQL_FN_NUM_SQRT 0x00004000L
+#define SQL_FN_NUM_TAN 0x00008000L
+#define SQL_FN_NUM_TRUNCATE 0x00800000L
+#define SQL_FN_STR_ASCII 0x00002000L
+#define SQL_FN_STR_CHAR 0x00004000L
+#define SQL_FN_STR_CONCAT 0x00000001L
+#define SQL_FN_STR_DIFFERENCE 0x00008000L
+#define SQL_FN_STR_INSERT 0x00000002L
+#define SQL_FN_STR_LCASE 0x00000040L
+#define SQL_FN_STR_LEFT 0x00000004L
+#define SQL_FN_STR_LENGTH 0x00000010L
+#define SQL_FN_STR_LOCATE 0x00000020L
+#define SQL_FN_STR_LOCATE_2 0x00010000L
+#define SQL_FN_STR_LTRIM 0x00000008L
+#define SQL_FN_STR_REPEAT 0x00000080L
+#define SQL_FN_STR_REPLACE 0x00000100L
+#define SQL_FN_STR_RIGHT 0x00000200L
+#define SQL_FN_STR_RTRIM 0x00000400L
+#define SQL_FN_STR_SOUNDEX 0x00020000L
+#define SQL_FN_STR_SPACE 0x00040000L
+#define SQL_FN_STR_SUBSTRING 0x00000800L
+#define SQL_FN_STR_UCASE 0x00001000L
+#define SQL_FN_SYS_DBNAME 0x00000002L
+#define SQL_FN_SYS_IFNULL 0x00000004L
+#define SQL_FN_SYS_USERNAME 0x00000001L
+#define SQL_FN_TD_CURDATE 0x00000002L
+#define SQL_FN_TD_CURTIME 0x00000200L
+#define SQL_FN_TD_DAYNAME 0x00008000L
+#define SQL_FN_TD_DAYOFMONTH 0x00000004L
+#define SQL_FN_TD_DAYOFWEEK 0x00000008L
+#define SQL_FN_TD_DAYOFYEAR 0x00000010L
+#define SQL_FN_TD_HOUR 0x00000400L
+#define SQL_FN_TD_MINUTE 0x00000800L
+#define SQL_FN_TD_MONTH 0x00000020L
+#define SQL_FN_TD_MONTHNAME 0x00010000L
+#define SQL_FN_TD_NOW 0x00000001L
+#define SQL_FN_TD_QUARTER 0x00000040L
+#define SQL_FN_TD_SECOND 0x00001000L
+#define SQL_FN_TD_TIMESTAMPADD 0x00002000L
+#define SQL_FN_TD_TIMESTAMPDIFF 0x00004000L
+#define SQL_FN_TD_WEEK 0x00000080L
+#define SQL_FN_TD_YEAR 0x00000100L
+#define SQL_FN_TSI_DAY 0x00000010L
+#define SQL_FN_TSI_FRAC_SECOND 0x00000001L
+#define SQL_FN_TSI_HOUR 0x00000008L
+#define SQL_FN_TSI_MINUTE 0x00000004L
+#define SQL_FN_TSI_MONTH 0x00000040L
+#define SQL_FN_TSI_QUARTER 0x00000080L
+#define SQL_FN_TSI_SECOND 0x00000002L
+#define SQL_FN_TSI_WEEK 0x00000020L
+#define SQL_FN_TSI_YEAR 0x00000100L
+#define SQL_GB_GROUP_BY_CONTAINS_SELECT 2
+#define SQL_GB_GROUP_BY_EQUALS_SELECT 1
+#define SQL_GB_NO_RELATION 3
+#define SQL_GB_NOT_SUPPORTED 0
+#define SQL_GD_BLOCK 4
+#define SQL_GD_BOUND 8
+#define SQL_GET_BOOKMARK 13
+#define SQL_GROUP_BY 88
+#define SQL_IGNORE (-6)
+#define SQL_INFO_FIRST 0
+#define SQL_KEYSET_SIZE 8
+#define SQL_KEYSET_SIZE_DEFAULT 0UL
+#define SQL_KEYWORDS 89
+#define SQL_LCK_EXCLUSIVE 2
+#define SQL_LCK_NO_CHANGE 1
+#define SQL_LCK_UNLOCK 4
+#define SQL_LEN_BINARY_ATTR(length) (-(length)+SQL_LEN_BINARY_ATTR_OFFSET)
+#define SQL_LEN_BINARY_ATTR_OFFSET (-100)
+#define SQL_LEN_DATA_AT_EXEC(length) (-(length)+SQL_LEN_DATA_AT_EXEC_OFFSET)
+#define SQL_LEN_DATA_AT_EXEC_OFFSET (-100)
+#define SQL_LIKE_ESCAPE_CLAUSE 113
+#define SQL_LIKE_ONLY 1
+#define SQL_LOCK_EXCLUSIVE 1
+#define SQL_LOCK_NO_CHANGE 0
+#define SQL_LOCK_TYPES 78
+#define SQL_LOCK_UNLOCK 2
+#define SQL_LOGIN_TIMEOUT 103
+#define SQL_LOGIN_TIMEOUT_DEFAULT 15UL
+#define SQL_LONGVARBINARY (-4)
+#define SQL_LONGVARCHAR (-1)
+#define SQL_MAX_BINARY_LITERAL_LEN 112
+#define SQL_MAX_CHAR_LITERAL_LEN 108
+#define SQL_MAX_DSN_LENGTH 32
+#define SQL_MAX_LENGTH 3
+#define SQL_MAX_LENGTH_DEFAULT 0UL
+#define SQL_MAX_OPTION_STRING_LENGTH 256
+#define SQL_MAX_OWNER_NAME_LEN 32
+#define SQL_MAX_PROCEDURE_NAME_LEN 33
+#define SQL_MAX_QUALIFIER_NAME_LEN 34
+#define SQL_MAX_ROW_SIZE_INCLUDES_LONG 103
+#define SQL_MAX_ROWS 1
+#define SQL_MAX_ROWS_DEFAULT 0UL
+#define SQL_MODE_DEFAULT SQL_MODE_READ_WRITE
+#define SQL_MODE_READ_ONLY 1UL
+#define SQL_MODE_READ_WRITE 0UL
+#define SQL_MULT_RESULT_SETS 36
+#define SQL_MULTIPLE_ACTIVE_TXN 37
+#define SQL_NC_END 0x0004
+#define SQL_NC_START 0x0002
+#define SQL_NEED_LONG_DATA_LEN 111
+#define SQL_NNC_NON_NULL 0x0001
+#define SQL_NNC_NULL 0x0000
+#define SQL_NO_TOTAL (-4)
+#define SQL_NON_NULLABLE_COLUMNS 75
+#define SQL_NOSCAN 2
+#define SQL_NOSCAN_DEFAULT SQL_NOSCAN_OFF
+#define SQL_NOSCAN_OFF 0UL
+#define SQL_NOSCAN_ON 1UL
+#define SQL_NUMERIC_FUNCTIONS 49
+#define SQL_OAC_LEVEL1 0x0001
+#define SQL_OAC_LEVEL2 0x0002
+#define SQL_OAC_NONE 0x0000
+#define SQL_ODBC_API_CONFORMANCE 9
+#define SQL_ODBC_CURSORS 110
+#define SQL_ODBC_SAG_CLI_CONFORMANCE 12
+#define SQL_ODBC_SQL_CONFORMANCE 15
+#define SQL_ODBC_SQL_OPT_IEF 73
+#define SQL_ODBC_VER 10
+#define SQL_OPT_TRACE 104
+#define SQL_OPT_TRACE_DEFAULT SQL_OPT_TRACE_OFF
+#define SQL_OPT_TRACE_FILE_DEFAULT "\\SQL.LOG"
+#define SQL_OPT_TRACE_OFF 0UL
+#define SQL_OPT_TRACE_ON 1UL
+#define SQL_OPT_TRACEFILE 105
+#define SQL_OSC_CORE 1
+#define SQL_OSC_EXTENDED 2
+#define SQL_OSC_MINIMUM 0
+#define SQL_OSCC_COMPLIANT 1
+#define SQL_OSCC_NOT_COMPLIANT 0
+#define SQL_OU_DML_STATEMENTS 1
+#define SQL_OU_INDEX_DEFINITION 8
+#define SQL_OU_PRIVILEGE_DEFINITION 16
+#define SQL_OU_PROCEDURE_INVOCATION 2
+#define SQL_OU_TABLE_DEFINITION 4
+#define SQL_OUTER_JOINS 38
+#define SQL_OWNER_TERM 39
+#define SQL_OWNER_USAGE 91
+#define SQL_PACKET_SIZE 112
+#define SQL_PARAM_INPUT 1
+#define SQL_PARAM_INPUT_OUTPUT 2
+#define SQL_PARAM_OUTPUT 4
+#define SQL_PARAM_TYPE_DEFAULT SQL_PARAM_INPUT_OUTPUT
+#define SQL_PARAM_TYPE_UNKNOWN 0
+#define SQL_PC_NOT_PSEUDO 1
+#define SQL_POS_ADD 16
+#define SQL_POS_DELETE 8
+#define SQL_POS_OPERATIONS 79
+#define SQL_POS_POSITION 1
+#define SQL_POS_REFRESH 2
+#define SQL_POS_UPDATE 4
+#define SQL_POSITION 0
+#define SQL_POSITIONED_STATEMENTS 80
+#define SQL_PRED_SEARCHABLE SQL_SEARCHABLE
+#define SQL_PROCEDURE_TERM 40
+#define SQL_PROCEDURES 21
+#define SQL_PS_POSITIONED_DELETE 1
+#define SQL_PS_POSITIONED_UPDATE 2
+#define SQL_PS_SELECT_FOR_UPDATE 4
+#define SQL_PT_FUNCTION 2
+#define SQL_PT_PROCEDURE 1
+#define SQL_PT_UNKNOWN 0
+#define SQL_QL_END 0x0002
+#define SQL_QL_START 0x0001
+#define SQL_QU_DML_STATEMENTS 1
+#define SQL_QU_INDEX_DEFINITION 8
+#define SQL_QU_PRIVILEGE_DEFINITION 16
+#define SQL_QU_PROCEDURE_INVOCATION 2
+#define SQL_QU_TABLE_DEFINITION 4
+#define SQL_QUALIFIER_LOCATION 114
+#define SQL_QUALIFIER_NAME_SEPARATOR 41
+#define SQL_QUALIFIER_TERM 42
+#define SQL_QUALIFIER_USAGE 92
+#define SQL_QUERY_TIMEOUT 0
+#define SQL_QUERY_TIMEOUT_DEFAULT 0UL
+#define SQL_QUICK 0
+#define SQL_QUIET_MODE 111
+#define SQL_QUOTED_IDENTIFIER_CASE 93
+#define SQL_RD_DEFAULT SQL_RD_ON
+#define SQL_RD_OFF 0UL
+#define SQL_RD_ON 1UL
+#define SQL_REFRESH 1
+#define SQL_RESTRICT 1
+#define SQL_RESULT_COL 3
+#define SQL_RETRIEVE_DATA 11
+#define SQL_RETURN_VALUE 5
+#define SQL_ROW_ADDED 4
+#define SQL_ROW_DELETED 1
+#define SQL_ROW_ERROR 5
+#define SQL_ROW_NOROW 3
+#define SQL_ROW_NUMBER 14
+#define SQL_ROW_SUCCESS 0
+#define SQL_ROW_UPDATED 2
+#define SQL_ROW_UPDATES 11
+#define SQL_ROWSET_SIZE 9
+#define SQL_ROWSET_SIZE_DEFAULT 1UL
+#define SQL_ROWVER 2
+#define SQL_SC_NON_UNIQUE 0UL
+#define SQL_SC_TRY_UNIQUE 1UL
+#define SQL_SC_UNIQUE 2UL
+#define SQL_SCCO_OPT_TIMESTAMP SQL_SCCO_OPT_ROWVER /* deprecated */ 
+#define SQL_SCROLL_DYNAMIC (-2L) /* deprecated */   
+#define SQL_SCROLL_FORWARD_ONLY 0L /* deprecated */   
+#define SQL_SCROLL_KEYSET_DRIVEN (-1L) /* deprecated */   
+#define SQL_SCROLL_OPTIONS 44
+#define SQL_SCROLL_STATIC (-3L) /* deprecated */   
+#define SQL_SEARCHABLE 3
+#define SQL_SET_NULL 2
+#define SQL_SETPARAM_VALUE_MAX (-1L)
+#define SQL_SETPOS_MAX_LOCK_VALUE SQL_LOCK_UNLOCK
+#define SQL_SETPOS_MAX_OPTION_VALUE SQL_ADD
+#define SQL_SIGNED_OFFSET (-20)
+#define SQL_SIMULATE_CURSOR 10
+#define SQL_SO_DYNAMIC 4
+#define SQL_SO_FORWARD_ONLY 1
+#define SQL_SO_KEYSET_DRIVEN 2
+#define SQL_SO_MIXED 8
+#define SQL_SO_STATIC 16
+#define SQL_SQ_COMPARISON 1
+#define SQL_SQ_CORRELATED_SUBQUERIES 16
+#define SQL_SQ_EXISTS 2
+#define SQL_SQ_IN 4
+#define SQL_SQ_QUANTIFIED 8
+#define SQL_SQLSTATE_SIZE 5
+#define SQL_SS_ADDITIONS 1
+#define SQL_SS_DELETIONS 2
+#define SQL_SS_UPDATES 4
+#define SQL_STATIC_SENSITIVITY 83
+#define SQL_STRING_FUNCTIONS 50
+#define SQL_SUBQUERIES 95
+#define SQL_SYSTEM_FUNCTIONS 51
+#define SQL_TABLE_STAT 0
+#define SQL_TABLE_TERM 45
+#define SQL_TIME 10
+#define SQL_TIMEDATE_ADD_INTERVALS 109
+#define SQL_TIMEDATE_DIFF_INTERVALS 110
+#define SQL_TIMEDATE_FUNCTIONS 52
+#define SQL_TIMESTAMP 11
+#define SQL_TINYINT (-6)
+#define SQL_TRANSLATE_DLL 106
+#define SQL_TRANSLATE_OPTION 107
+#define SQL_TXN_ISOLATION 108
+#define SQL_TXN_VERSIONING 16
+#define SQL_TYPE_NULL 0
+#define SQL_U_UNION 1
+#define SQL_U_UNION_ALL 2
+#define SQL_UB_DEFAULT SQL_UB_OFF
+#define SQL_UB_OFF 0UL
+#define SQL_UB_ON 01UL
+#define SQL_UNION 96
+#define SQL_UNSEARCHABLE 0
+#define SQL_UNSIGNED_OFFSET (-22)
+#define SQL_UPDATE 2 
+#define SQL_USE_BOOKMARKS 12
+#define SQL_VARBINARY (-3)
+#define SQL_POSITION_TO(s,r) SQLSetPos(s,r,SQL_POSITION,SQL_LOCK_NO_CHANGE)
+#define SQL_LOCK_RECORD(s,r,l) SQLSetPos(s,r,SQL_POSITION,l)
+#define SQL_REFRESH_RECORD(s,r,l) SQLSetPos(s,r,SQL_REFRESH,l)
+#define SQL_UPDATE_RECORD(s,r) SQLSetPos(s,r,SQL_UPDATE,SQL_LOCK_NO_CHANGE)
+#define SQL_DELETE_RECORD(s,r) SQLSetPos(s,r,SQL_DELETE,SQL_LOCK_NO_CHANGE)
+#define SQL_ADD_RECORD(s,r) SQLSetPos(s,r,SQL_ADD,SQL_LOCK_NO_CHANGE)
+
+#if (ODBCVER < 0x0300)
+#define SQL_CONNECT_OPT_DRVR_START 1000
+#define SQL_CONN_OPT_MAX SQL_PACKET_SIZE
+#define SQL_CONN_OPT_MIN SQL_ACCESS_MODE
+#define SQL_STMT_OPT_MAX SQL_ROW_NUMBER
+#define SQL_STMT_OPT_MIN SQL_QUERY_TIMEOUT
+#define SQL_TYPE_DRIVER_START SQL_INTERVAL_YEAR
+#define SQL_TYPE_DRIVER_END SQL_UNICODE_LONGVARCHAR
+#define SQL_TYPE_MIN SQL_BIT
+#define SQL_TYPE_MAX SQL_VARCHAR
+#endif
+
+#if (ODBCVER < 0x0300)
+#define SQL_NO_DATA_FOUND 100
+#define SQL_INTERVAL_YEAR (-80)
+#define SQL_INTERVAL_MONTH (-81)
+#define SQL_INTERVAL_YEAR_TO_MONTH (-82)
+#define SQL_INTERVAL_DAY (-83)
+#define SQL_INTERVAL_HOUR (-84)
+#define SQL_INTERVAL_MINUTE (-85)
+#define SQL_INTERVAL_SECOND (-86)
+#define SQL_INTERVAL_DAY_TO_HOUR (-87)
+#define SQL_INTERVAL_DAY_TO_MINUTE (-88)
+#define SQL_INTERVAL_DAY_TO_SECOND (-89)
+#define SQL_INTERVAL_HOUR_TO_MINUTE (-90)
+#define SQL_INTERVAL_HOUR_TO_SECOND (-91)
+#define SQL_INTERVAL_MINUTE_TO_SECOND (-92)
+#else  
+#define SQL_NO_DATA_FOUND SQL_NO_DATA
+#define SQL_CODE_YEAR 1
+#define SQL_CODE_MONTH 2
+#define SQL_CODE_DAY 3
+#define SQL_CODE_HOUR 4
+#define SQL_CODE_MINUTE 5
+#define SQL_CODE_SECOND 6
+#define SQL_CODE_YEAR_TO_MONTH 7
+#define SQL_CODE_DAY_TO_HOUR 8
+#define SQL_CODE_DAY_TO_MINUTE 9
+#define SQL_CODE_DAY_TO_SECOND 10
+#define SQL_CODE_HOUR_TO_MINUTE 11
+#define SQL_CODE_HOUR_TO_SECOND 12
+#define SQL_CODE_MINUTE_TO_SECOND 13
+#define SQL_INTERVAL_YEAR (100 + SQL_CODE_YEAR)
+#define SQL_INTERVAL_MONTH (100 + SQL_CODE_MONTH)
+#define SQL_INTERVAL_DAY (100 + SQL_CODE_DAY)
+#define SQL_INTERVAL_HOUR (100 + SQL_CODE_HOUR)
+#define SQL_INTERVAL_MINUTE (100 + SQL_CODE_MINUTE)
+#define SQL_INTERVAL_SECOND (100 + SQL_CODE_SECOND)
+#define SQL_INTERVAL_YEAR_TO_MONTH (100 + SQL_CODE_YEAR_TO_MONTH)  
+#define SQL_INTERVAL_DAY_TO_HOUR (100 + SQL_CODE_DAY_TO_HOUR)
+#define SQL_INTERVAL_DAY_TO_MINUTE (100 + SQL_CODE_DAY_TO_MINUTE)
+#define SQL_INTERVAL_DAY_TO_SECOND (100 + SQL_CODE_DAY_TO_SECOND)
+#define SQL_INTERVAL_HOUR_TO_MINUTE (100 + SQL_CODE_HOUR_TO_MINUTE)
+#define SQL_INTERVAL_HOUR_TO_SECOND (100 + SQL_CODE_HOUR_TO_SECOND)
+#define SQL_INTERVAL_MINUTE_TO_SECOND (100 + SQL_CODE_MINUTE_TO_SECOND)
+#endif
+
+#if (ODBCVER <= 0x0300)
+#define SQL_UNICODE (-95)
+#define SQL_UNICODE_VARCHAR (-96)
+#define SQL_UNICODE_LONGVARCHAR (-97)
+#define SQL_UNICODE_CHAR SQL_UNICODE
+#else
+#define SQL_UNICODE SQL_WCHAR
+#define SQL_UNICODE_VARCHAR SQL_WVARCHAR
+#define SQL_UNICODE_LONGVARCHAR SQL_WLONGVARCHAR
+#define SQL_UNICODE_CHAR SQL_WCHAR
+#endif
+
+#if (ODBCVER >= 0x0201) && (ODBCVER < 0x0300) 
+#define SQL_OJ_CAPABILITIES 65003  
+#endif /* ODBCVER < 0x0300 */
+
+#if (ODBCVER >= 0x0250)
+#define SQL_NO_ACTION 3
+#define SQL_SET_DEFAULT 4
+#endif /* ODBCVER >= 0x0250 */
+
+#if (ODBCVER >= 0x0300)
+#define SQL_ACTIVE_ENVIRONMENTS 116
+#define SQL_AD_ADD_CONSTRAINT_DEFERRABLE 0x00000080L
+#define SQL_AD_ADD_CONSTRAINT_INITIALLY_DEFERRED 0x00000020L
+#define SQL_AD_ADD_CONSTRAINT_INITIALLY_IMMEDIATE 0x00000040L
+#define SQL_AD_ADD_CONSTRAINT_NON_DEFERRABLE 0x00000100L
+#define SQL_AD_ADD_DOMAIN_CONSTRAINT 0x00000002L
+#define SQL_AD_ADD_DOMAIN_DEFAULT 0x00000008L
+#define SQL_AD_CONSTRAINT_NAME_DEFINITION 0x00000001L
+#define SQL_AD_DROP_DOMAIN_CONSTRAINT 0x00000004L
+#define SQL_AD_DROP_DOMAIN_DEFAULT 0x00000010L
+#define SQL_AF_ALL 0x00000040L
+#define SQL_AF_AVG 0x00000001L
+#define SQL_AF_COUNT 0x00000002L
+#define SQL_AF_DISTINCT 0x00000020L
+#define SQL_AF_MAX 0x00000004L
+#define SQL_AF_MIN 0x00000008L
+#define SQL_AF_SUM 0x00000010L
+#define SQL_AGGREGATE_FUNCTIONS 169
+#define SQL_ALL_CATALOGS "%"
+#define SQL_ALL_SCHEMAS "%"
+#define SQL_ALL_TABLE_TYPES "%"
+#define SQL_ALTER_DOMAIN 117
+#define SQL_AM_CONNECTION 1
+#define SQL_AM_NONE 0
+#define SQL_AM_STATEMENT 2
+#define SQL_API_ODBC3_ALL_FUNCTIONS 999
+#define SQL_API_ODBC3_ALL_FUNCTIONS_SIZE 250
+#define SQL_API_SQLALLOCHANDLESTD 73
+#define SQL_API_SQLBULKOPERATIONS 24
+#define SQL_ASYNC_MODE 10021
+#define SQL_AT_ADD_COLUMN_COLLATION 0x00000080L
+#define SQL_AT_ADD_COLUMN_DEFAULT 0x00000040L
+#define SQL_AT_ADD_COLUMN_SINGLE 0x00000020L
+#define SQL_AT_ADD_TABLE_CONSTRAINT 0x00001000L
+#define SQL_AT_CONSTRAINT_DEFERRABLE 0x00040000L
+#define SQL_AT_CONSTRAINT_INITIALLY_DEFERRED 0x00010000L
+#define SQL_AT_CONSTRAINT_INITIALLY_IMMEDIATE 0x00020000L
+#define SQL_AT_CONSTRAINT_NAME_DEFINITION 0x00008000L
+#define SQL_AT_CONSTRAINT_NON_DEFERRABLE 0x00080000L
+#define SQL_AT_DROP_COLUMN_CASCADE 0x00000400L
+#define SQL_AT_DROP_COLUMN_DEFAULT 0x00000200L
+#define SQL_AT_DROP_COLUMN_RESTRICT 0x00000800L
+#define SQL_AT_DROP_TABLE_CONSTRAINT_CASCADE 0x00002000L
+#define SQL_AT_DROP_TABLE_CONSTRAINT_RESTRICT 0x00004000L
+#define SQL_AT_SET_COLUMN_DEFAULT 0x00000100L
+#define SQL_ATTR_ACCESS_MODE SQL_ACCESS_MODE
+#define SQL_ATTR_ASYNC_ENABLE 4
+#define SQL_ATTR_AUTOCOMMIT SQL_AUTOCOMMIT
+#define SQL_ATTR_CONCURRENCY SQL_CONCURRENCY
+#define SQL_ATTR_CONNECTION_POOLING 201
+#define SQL_ATTR_CONNECTION_TIMEOUT 113
+#define SQL_ATTR_CP_MATCH 202
+#define SQL_ATTR_CURRENT_CATALOG SQL_CURRENT_QUALIFIER
+#define SQL_ATTR_CURSOR_TYPE SQL_CURSOR_TYPE
+#define SQL_ATTR_DISCONNECT_BEHAVIOR 114
+#define SQL_ATTR_ENABLE_AUTO_IPD 15
+#define SQL_ATTR_ENLIST_IN_DTC 1207
+#define SQL_ATTR_ENLIST_IN_XA 1208
+#define SQL_ATTR_FETCH_BOOKMARK_PTR 16
+#define SQL_ATTR_KEYSET_SIZE SQL_KEYSET_SIZE
+#define SQL_ATTR_LOGIN_TIMEOUT SQL_LOGIN_TIMEOUT
+#define SQL_ATTR_MAX_LENGTH SQL_MAX_LENGTH
+#define SQL_ATTR_MAX_ROWS SQL_MAX_ROWS
+#define SQL_ATTR_NOSCAN SQL_NOSCAN
+#define SQL_ATTR_ODBC_CURSORS SQL_ODBC_CURSORS
+#define SQL_ATTR_ODBC_VERSION 200
+#define SQL_ATTR_PACKET_SIZE SQL_PACKET_SIZE
+#define SQL_ATTR_PARAM_BIND_OFFSET_PTR 17
+#define SQL_ATTR_PARAM_BIND_TYPE 18
+#define SQL_ATTR_PARAM_OPERATION_PTR 19
+#define SQL_ATTR_PARAM_STATUS_PTR 20
+#define SQL_ATTR_PARAMS_PROCESSED_PTR 21
+#define SQL_ATTR_PARAMSET_SIZE 22
+#define SQL_ATTR_QUERY_TIMEOUT SQL_QUERY_TIMEOUT
+#define SQL_ATTR_QUIET_MODE SQL_QUIET_MODE
+#define SQL_ATTR_RETRIEVE_DATA SQL_RETRIEVE_DATA
+#define SQL_ATTR_ROW_ARRAY_SIZE 27
+#define SQL_ATTR_ROW_BIND_OFFSET_PTR 23
+#define SQL_ATTR_ROW_BIND_TYPE SQL_BIND_TYPE
+#define SQL_ATTR_ROW_NUMBER SQL_ROW_NUMBER
+#define SQL_ATTR_ROW_OPERATION_PTR 24
+#define SQL_ATTR_ROW_STATUS_PTR 25
+#define SQL_ATTR_ROWS_FETCHED_PTR 26
+#define SQL_ATTR_SIMULATE_CURSOR SQL_SIMULATE_CURSOR
+#define SQL_ATTR_TRACE SQL_OPT_TRACE
+#define SQL_ATTR_TRACEFILE SQL_OPT_TRACEFILE
+#define SQL_ATTR_TRANSLATE_LIB SQL_TRANSLATE_DLL
+#define SQL_ATTR_TRANSLATE_OPTION SQL_TRANSLATE_OPTION
+#define SQL_ATTR_TXN_ISOLATION SQL_TXN_ISOLATION
+#define SQL_ATTR_USE_BOOKMARKS SQL_USE_BOOKMARKS
+#define SQL_BATCH_ROW_COUNT 120
+#define SQL_BATCH_SUPPORT 121
+#define SQL_BRC_EXPLICIT 0x0000002
+#define SQL_BRC_PROCEDURES 0x0000001
+#define SQL_BRC_ROLLED_UP 0x0000004
+#define SQL_BS_ROW_COUNT_EXPLICIT 0x00000002L
+#define SQL_BS_ROW_COUNT_PROC 0x00000008L
+#define SQL_BS_SELECT_EXPLICIT 0x00000001L
+#define SQL_BS_SELECT_PROC 0x00000004L
+#define SQL_C_INTERVAL_DAY SQL_INTERVAL_DAY
+#define SQL_C_INTERVAL_DAY_TO_HOUR SQL_INTERVAL_DAY_TO_HOUR
+#define SQL_C_INTERVAL_DAY_TO_MINUTE SQL_INTERVAL_DAY_TO_MINUTE
+#define SQL_C_INTERVAL_DAY_TO_SECOND SQL_INTERVAL_DAY_TO_SECOND
+#define SQL_C_INTERVAL_HOUR SQL_INTERVAL_HOUR
+#define SQL_C_INTERVAL_HOUR_TO_MINUTE SQL_INTERVAL_HOUR_TO_MINUTE
+#define SQL_C_INTERVAL_HOUR_TO_SECOND SQL_INTERVAL_HOUR_TO_SECOND
+#define SQL_C_INTERVAL_MINUTE SQL_INTERVAL_MINUTE
+#define SQL_C_INTERVAL_MINUTE_TO_SECOND SQL_INTERVAL_MINUTE_TO_SECOND
+#define SQL_C_INTERVAL_MONTH SQL_INTERVAL_MONTH
+#define SQL_C_INTERVAL_SECOND SQL_INTERVAL_SECOND
+#define SQL_C_INTERVAL_YEAR SQL_INTERVAL_YEAR
+#define SQL_C_INTERVAL_YEAR_TO_MONTH SQL_INTERVAL_YEAR_TO_MONTH
+#define SQL_C_NUMERIC SQL_NUMERIC
+#define SQL_C_SBIGINT (SQL_BIGINT+SQL_SIGNED_OFFSET)
+#define SQL_C_TYPE_DATE SQL_TYPE_DATE
+#define SQL_C_TYPE_TIME SQL_TYPE_TIME
+#define SQL_C_TYPE_TIMESTAMP SQL_TYPE_TIMESTAMP
+#define SQL_C_UBIGINT (SQL_BIGINT+SQL_UNSIGNED_OFFSET)
+#define SQL_C_VARBOOKMARK SQL_C_BINARY
+#define SQL_CA_CONSTRAINT_DEFERRABLE 0x00000040L
+#define SQL_CA_CONSTRAINT_INITIALLY_DEFERRED 0x00000010L
+#define SQL_CA_CONSTRAINT_INITIALLY_IMMEDIATE 0x00000020L
+#define SQL_CA_CONSTRAINT_NON_DEFERRABLE 0x00000080L
+#define SQL_CA_CREATE_ASSERTION 0x00000001L
+#define SQL_CA1_ABSOLUTE 0x00000002L
+#define SQL_CA1_BOOKMARK 0x00000008L
+#define SQL_CA1_BULK_ADD 0x00010000L
+#define SQL_CA1_BULK_DELETE_BY_BOOKMARK 0x00040000L
+#define SQL_CA1_BULK_FETCH_BY_BOOKMARK 0x00080000L
+#define SQL_CA1_BULK_UPDATE_BY_BOOKMARK 0x00020000L
+#define SQL_CA1_LOCK_EXCLUSIVE 0x00000080L
+#define SQL_CA1_LOCK_NO_CHANGE 0x00000040L
+#define SQL_CA1_LOCK_UNLOCK 0x00000100L
+#define SQL_CA1_NEXT 0x00000001L
+#define SQL_CA1_POS_DELETE 0x00000800L
+#define SQL_CA1_POS_POSITION 0x00000200L
+#define SQL_CA1_POS_REFRESH 0x00001000L
+#define SQL_CA1_POS_UPDATE 0x00000400L
+#define SQL_CA1_POSITIONED_DELETE 0x00004000L
+#define SQL_CA1_POSITIONED_UPDATE 0x00002000L
+#define SQL_CA1_RELATIVE 0x00000004L
+#define SQL_CA1_SELECT_FOR_UPDATE 0x00008000L
+#define SQL_CA2_CRC_APPROXIMATE 0x00002000L
+#define SQL_CA2_CRC_EXACT 0x00001000L
+#define SQL_CA2_LOCK_CONCURRENCY 0x00000002L
+#define SQL_CA2_MAX_ROWS_AFFECTS_ALL (SQL_CA2_MAX_ROWS_SELECT | SQL_CA2_MAX_ROWS_INSERT | \
+    SQL_CA2_MAX_ROWS_DELETE | SQL_CA2_MAX_ROWS_UPDATE | SQL_CA2_MAX_ROWS_CATALOG)
+#define SQL_CA2_MAX_ROWS_CATALOG 0x00000800L
+#define SQL_CA2_MAX_ROWS_DELETE 0x00000200L
+#define SQL_CA2_MAX_ROWS_INSERT 0x00000100L
+#define SQL_CA2_MAX_ROWS_SELECT 0x00000080L
+#define SQL_CA2_MAX_ROWS_UPDATE 0x00000400L
+#define SQL_CA2_OPT_ROWVER_CONCURRENCY 0x00000004L
+#define SQL_CA2_OPT_VALUES_CONCURRENCY 0x00000008L
+#define SQL_CA2_READ_ONLY_CONCURRENCY 0x00000001L
+#define SQL_CA2_SENSITIVITY_ADDITIONS 0x00000010L
+#define SQL_CA2_SENSITIVITY_DELETIONS 0x00000020L
+#define SQL_CA2_SENSITIVITY_UPDATES 0x00000040L
+#define SQL_CA2_SIMULATE_NON_UNIQUE 0x00004000L
+#define SQL_CA2_SIMULATE_TRY_UNIQUE 0x00008000L
+#define SQL_CA2_SIMULATE_UNIQUE 0x00010000L
+#define SQL_CATALOG_LOCATION SQL_QUALIFIER_LOCATION
+#define SQL_CATALOG_NAME_SEPARATOR SQL_QUALIFIER_NAME_SEPARATOR
+#define SQL_CATALOG_TERM SQL_QUALIFIER_TERM
+#define SQL_CATALOG_USAGE SQL_QUALIFIER_USAGE
+#define SQL_CCOL_CREATE_COLLATION 0x00000001L
+#define SQL_CCS_COLLATE_CLAUSE 0x00000002L
+#define SQL_CCS_CREATE_CHARACTER_SET 0x00000001L
+#define SQL_CCS_LIMITED_COLLATION 0x00000004L
+#define SQL_CDO_COLLATION 0x00000008L
+#define SQL_CDO_CONSTRAINT 0x00000004L
+#define SQL_CDO_CONSTRAINT_DEFERRABLE 0x00000080L
+#define SQL_CDO_CONSTRAINT_INITIALLY_DEFERRED 0x00000020L
+#define SQL_CDO_CONSTRAINT_INITIALLY_IMMEDIATE 0x00000040L
+#define SQL_CDO_CONSTRAINT_NAME_DEFINITION 0x00000010L
+#define SQL_CDO_CONSTRAINT_NON_DEFERRABLE 0x00000100L
+#define SQL_CDO_CREATE_DOMAIN 0x00000001L
+#define SQL_CDO_DEFAULT 0x00000002L
+#define SQL_CL_END SQL_QL_END
+#define SQL_CL_START SQL_QL_START
+#define SQL_COL_PRED_BASIC SQL_ALL_EXCEPT_LIKE
+#define SQL_COL_PRED_CHAR SQL_LIKE_ONLY
+#define SQL_COLUMN_DRIVER_START 1000
+#define SQL_COLUMN_IGNORE SQL_IGNORE
+#define SQL_COLUMN_NUMBER_UNKNOWN (-2)
+#define SQL_CONVERT_GUID 173
+#define SQL_CONVERT_INTERVAL_DAY_TIME 123
+#define SQL_CONVERT_INTERVAL_YEAR_MONTH 124
+#define SQL_CONVERT_WCHAR 122
+#define SQL_CONVERT_WLONGVARCHAR 125
+#define SQL_CONVERT_WVARCHAR 126
+#define SQL_CP_DEFAULT SQL_CP_OFF
+#define SQL_CP_MATCH_DEFAULT SQL_CP_STRICT_MATCH
+#define SQL_CP_OFF 0UL
+#define SQL_CP_ONE_PER_DRIVER 1UL
+#define SQL_CP_ONE_PER_HENV 2UL
+#define SQL_CP_RELAXED_MATCH 1UL
+#define SQL_CP_STRICT_MATCH 0UL
+#define SQL_CREATE_ASSERTION 127
+#define SQL_CREATE_CHARACTER_SET 128
+#define SQL_CREATE_COLLATION 129
+#define SQL_CREATE_DOMAIN 130
+#define SQL_CREATE_SCHEMA 131
+#define SQL_CREATE_TABLE 132
+#define SQL_CREATE_TRANSLATION 133
+#define SQL_CREATE_VIEW 134
+#define SQL_CS_AUTHORIZATION 0x00000002L
+#define SQL_CS_CREATE_SCHEMA 0x00000001L
+#define SQL_CS_DEFAULT_CHARACTER_SET 0x00000004L
+#define SQL_CT_COLUMN_COLLATION 0x00000800L
+#define SQL_CT_COLUMN_CONSTRAINT 0x00000200L
+#define SQL_CT_COLUMN_DEFAULT 0x00000400L
+#define SQL_CT_COMMIT_DELETE 0x00000004L
+#define SQL_CT_COMMIT_PRESERVE 0x00000002L
+#define SQL_CT_CONSTRAINT_DEFERRABLE 0x00000080L
+#define SQL_CT_CONSTRAINT_INITIALLY_DEFERRED 0x00000020L
+#define SQL_CT_CONSTRAINT_INITIALLY_IMMEDIATE 0x00000040L
+#define SQL_CT_CONSTRAINT_NAME_DEFINITION 0x00002000L
+#define SQL_CT_CONSTRAINT_NON_DEFERRABLE 0x00000100L
+#define SQL_CT_CREATE_TABLE 0x00000001L
+#define SQL_CT_GLOBAL_TEMPORARY 0x00000008L
+#define SQL_CT_LOCAL_TEMPORARY 0x00000010L
+#define SQL_CT_TABLE_CONSTRAINT 0x00001000L
+#define SQL_CTR_CREATE_TRANSLATION 0x00000001L
+#define SQL_CU_DML_STATEMENTS SQL_QU_DML_STATEMENTS
+#define SQL_CU_INDEX_DEFINITION SQL_QU_INDEX_DEFINITION
+#define SQL_CU_PRIVILEGE_DEFINITION SQL_QU_PRIVILEGE_DEFINITION
+#define SQL_CU_PROCEDURE_INVOCATION SQL_QU_PROCEDURE_INVOCATION
+#define SQL_CU_TABLE_DEFINITION SQL_QU_TABLE_DEFINITION
+#define	SQL_CVT_GUID 0x1000000L
+#define SQL_CVT_INTERVAL_DAY_TIME 0x00100000L
+#define SQL_CVT_INTERVAL_YEAR_MONTH 0x00080000L
+#define SQL_CVT_WCHAR 0x00200000L
+#define SQL_CVT_WLONGVARCHAR 0x00400000L
+#define SQL_CVT_WVARCHAR 0x00800000L
+#define SQL_DA_DROP_ASSERTION 0x00000001L
+#define SQL_DATETIME_LITERALS 119
+#define SQL_DB_DEFAULT SQL_DB_RETURN_TO_POOL
+#define SQL_DB_DISCONNECT 1UL
+#define SQL_DB_RETURN_TO_POOL 0UL
+#define SQL_DC_DROP_COLLATION 0x00000001L
+#define SQL_DCS_DROP_CHARACTER_SET 0x00000001L
+#define SQL_DD_CASCADE 0x00000004L
+#define SQL_DD_DROP_DOMAIN 0x00000001L
+#define SQL_DD_RESTRICT 0x00000002L
+#define SQL_DDL_INDEX 170
+#define SQL_DELETE_BY_BOOKMARK 6
+#define SQL_DESC_ARRAY_SIZE 20
+#define SQL_DESC_ARRAY_STATUS_PTR 21
+#define SQL_DESC_AUTO_UNIQUE_VALUE SQL_COLUMN_AUTO_INCREMENT
+#define SQL_DESC_BASE_COLUMN_NAME 22
+#define SQL_DESC_BASE_TABLE_NAME 23
+#define SQL_DESC_BIND_OFFSET_PTR 24
+#define SQL_DESC_BIND_TYPE 25
+#define SQL_DESC_CASE_SENSITIVE SQL_COLUMN_CASE_SENSITIVE
+#define SQL_DESC_CATALOG_NAME SQL_COLUMN_QUALIFIER_NAME
+#define SQL_DESC_CONCISE_TYPE SQL_COLUMN_TYPE
+#define SQL_DESC_DATETIME_INTERVAL_PRECISION 26
+#define SQL_DESC_DISPLAY_SIZE SQL_COLUMN_DISPLAY_SIZE
+#define SQL_DESC_FIXED_PREC_SCALE SQL_COLUMN_MONEY
+#define SQL_DESC_LABEL SQL_COLUMN_LABEL
+#define SQL_DESC_LITERAL_PREFIX 27
+#define SQL_DESC_LITERAL_SUFFIX 28
+#define SQL_DESC_LOCAL_TYPE_NAME 29
+#define SQL_DESC_MAXIMUM_SCALE 30
+#define SQL_DESC_MINIMUM_SCALE 31
+#define SQL_DESC_NUM_PREC_RADIX 32
+#define SQL_DESC_PARAMETER_TYPE 33
+#define SQL_DESC_ROWS_PROCESSED_PTR 34
+#define SQL_DESC_SCHEMA_NAME SQL_COLUMN_OWNER_NAME
+#define SQL_DESC_SEARCHABLE SQL_COLUMN_SEARCHABLE
+#define SQL_DESC_TABLE_NAME SQL_COLUMN_TABLE_NAME
+#define SQL_DESC_TYPE_NAME SQL_COLUMN_TYPE_NAME
+#define SQL_DESC_UNSIGNED SQL_COLUMN_UNSIGNED
+#define SQL_DESC_UPDATABLE SQL_COLUMN_UPDATABLE
+#define SQL_DI_CREATE_INDEX 0x00000001L
+#define SQL_DI_DROP_INDEX 0x00000002L
+#define SQL_DIAG_COLUMN_NUMBER (-1247)
+#define SQL_DIAG_CURSOR_ROW_COUNT (-1249)
+#define SQL_DIAG_ROW_NUMBER (-1248)
+#define SQL_DL_SQL92_DATE 0x00000001L
+#define SQL_DL_SQL92_INTERVAL_DAY 0x00000020L
+#define SQL_DL_SQL92_INTERVAL_DAY_TO_HOUR 0x00000400L
+#define SQL_DL_SQL92_INTERVAL_DAY_TO_MINUTE 0x00000800L
+#define SQL_DL_SQL92_INTERVAL_DAY_TO_SECOND 0x00001000L
+#define SQL_DL_SQL92_INTERVAL_HOUR 0x00000040L
+#define SQL_DL_SQL92_INTERVAL_HOUR_TO_MINUTE 0x00002000L
+#define SQL_DL_SQL92_INTERVAL_HOUR_TO_SECOND 0x00004000L
+#define SQL_DL_SQL92_INTERVAL_MINUTE 0x00000080L
+#define SQL_DL_SQL92_INTERVAL_MINUTE_TO_SECOND 0x00008000L
+#define SQL_DL_SQL92_INTERVAL_MONTH 0x00000010L
+#define SQL_DL_SQL92_INTERVAL_SECOND 0x00000100L
+#define SQL_DL_SQL92_INTERVAL_YEAR 0x00000008L
+#define SQL_DL_SQL92_INTERVAL_YEAR_TO_MONTH 0x00000200L
+#define SQL_DL_SQL92_TIME 0x00000002L
+#define SQL_DL_SQL92_TIMESTAMP 0x00000004L
+#define SQL_DM_VER 171
+#define SQL_DRIVER_HDESC 135
+#define SQL_DROP_ASSERTION 136
+#define SQL_DROP_CHARACTER_SET 137
+#define SQL_DROP_COLLATION 138
+#define SQL_DROP_DOMAIN 139
+#define SQL_DROP_SCHEMA 140
+#define SQL_DROP_TABLE 141
+#define SQL_DROP_TRANSLATION 142
+#define SQL_DROP_VIEW 143
+#define SQL_DS_CASCADE 0x00000004L
+#define SQL_DS_DROP_SCHEMA 0x00000001L
+#define SQL_DS_RESTRICT 0x00000002L
+#define SQL_DT_CASCADE 0x00000004L
+#define SQL_DT_DROP_TABLE 0x00000001L
+#define SQL_DT_RESTRICT 0x00000002L
+#define SQL_DTC_DONE 0L
+#define SQL_DTR_DROP_TRANSLATION 0x00000001L
+#define SQL_DV_CASCADE 0x00000004L
+#define SQL_DV_DROP_VIEW 0x00000001L
+#define SQL_DV_RESTRICT 0x00000002L
+#define SQL_DYNAMIC_CURSOR_ATTRIBUTES1 144
+#define SQL_DYNAMIC_CURSOR_ATTRIBUTES2 145
+#define SQL_EXT_API_LAST SQL_API_SQLBINDPARAMETER
+#define SQL_EXT_API_START 40
+#define SQL_FETCH_BY_BOOKMARK 7
+#define SQL_FETCH_FIRST_SYSTEM 32
+#define SQL_FETCH_FIRST_USER 31  
+#define SQL_FN_CVT_CAST 0x00000002L
+#define SQL_FN_STR_BIT_LENGTH 0x00080000L
+#define SQL_FN_STR_CHAR_LENGTH 0x00100000L
+#define SQL_FN_STR_CHARACTER_LENGTH 0x00200000L
+#define SQL_FN_STR_OCTET_LENGTH 0x00400000L
+#define SQL_FN_STR_POSITION 0x00800000L
+#define SQL_FN_TD_CURRENT_DATE 0x00020000L
+#define SQL_FN_TD_CURRENT_TIME 0x00040000L
+#define SQL_FN_TD_CURRENT_TIMESTAMP 0x00080000L
+#define SQL_FN_TD_EXTRACT 0x00100000L
+#define SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES1 146
+#define SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES2 147
+#define SQL_FUNC_EXISTS(exists, api) \
+   ((*(((UWORD*) (exists)) + ((api) >> 4)) & (1 << ((api) & 15)) ) ? \
+   SQL_TRUE : SQL_FALSE )
+#define SQL_GB_COLLATE 0x0004
+#define SQL_HANDLE_SENV 5
+#define SQL_IK_ALL (SQL_IK_ASC | SQL_IK_DESC)
+#define SQL_IK_ASC 1
+#define SQL_IK_DESC 2
+#define SQL_IK_NONE 0
+#define SQL_INDEX_KEYWORDS 148
+#define SQL_INFO_DRIVER_START 1000
+#define SQL_INFO_LAST SQL_QUALIFIER_LOCATION
+#define SQL_INFO_SCHEMA_VIEWS 149
+#define SQL_INITIALLY_DEFERRED 5
+#define SQL_INITIALLY_IMMEDIATE 6
+#define SQL_INSERT_STATEMENT 172
+#define SQL_INTERVAL 10
+#define SQL_IS_INSERT_LITERALS 0x00000001L
+#define SQL_IS_INSERT_SEARCHED 0x00000002L
+#define SQL_IS_INTEGER (-6)
+#define SQL_IS_POINTER (-4)
+#define SQL_IS_SELECT_INTO 0x00000004L
+#define SQL_IS_SMALLINT (-8)
+#define SQL_IS_UINTEGER (-5)
+#define SQL_IS_USMALLINT (-7)
+#define SQL_ISV_ASSERTIONS 0x00000001L
+#define SQL_ISV_CHARACTER_SETS 0x00000002L
+#define SQL_ISV_CHECK_CONSTRAINTS 0x00000004L
+#define SQL_ISV_COLLATIONS 0x00000008L
+#define SQL_ISV_COLUMN_DOMAIN_USAGE 0x00000010L
+#define SQL_ISV_COLUMN_PRIVILEGES 0x00000020L
+#define SQL_ISV_COLUMNS 0x00000040L
+#define SQL_ISV_CONSTRAINT_COLUMN_USAGE 0x00000080L
+#define SQL_ISV_CONSTRAINT_TABLE_USAGE 0x00000100L
+#define SQL_ISV_DOMAIN_CONSTRAINTS 0x00000200L
+#define SQL_ISV_DOMAINS 0x00000400L
+#define SQL_ISV_KEY_COLUMN_USAGE 0x00000800L
+#define SQL_ISV_REFERENTIAL_CONSTRAINTS 0x00001000L
+#define SQL_ISV_SCHEMATA 0x00002000L
+#define SQL_ISV_SQL_LANGUAGES 0x00004000L
+#define SQL_ISV_TABLE_CONSTRAINTS 0x00008000L
+#define SQL_ISV_TABLE_PRIVILEGES 0x00010000L
+#define SQL_ISV_TABLES 0x00020000L
+#define SQL_ISV_TRANSLATIONS 0x00040000L
+#define SQL_ISV_USAGE_PRIVILEGES 0x00080000L
+#define SQL_ISV_VIEW_COLUMN_USAGE 0x00100000L
+#define SQL_ISV_VIEW_TABLE_USAGE 0x00200000L
+#define SQL_ISV_VIEWS 0x00400000L
+#define SQL_KEYSET_CURSOR_ATTRIBUTES1 150
+#define SQL_KEYSET_CURSOR_ATTRIBUTES2 151
+#define SQL_MAX_ASYNC_CONCURRENT_STATEMENTS 10022
+#define SQL_NO_COLUMN_NUMBER (-1)
+#define SQL_NO_ROW_NUMBER (-1)
+#define SQL_NOT_DEFERRABLE 7
+#define SQL_NUM_EXTENSIONS (SQL_EXT_API_LAST-SQL_EXT_API_START+1)
+#define SQL_NUM_FUNCTIONS 23
+#define SQL_ODBC_INTERFACE_CONFORMANCE 152
+#define SQL_OIC_CORE 1UL
+#define SQL_OIC_LEVEL1 2UL
+#define SQL_OIC_LEVEL2 3UL
+#define SQL_OV_ODBC2 2UL
+#define SQL_OV_ODBC3 3UL
+#define SQL_PARAM_ARRAY_ROW_COUNTS 153
+#define SQL_PARAM_ARRAY_SELECTS 154
+#define SQL_PARAM_BIND_BY_COLUMN 0UL
+#define SQL_PARAM_BIND_TYPE_DEFAULT SQL_PARAM_BIND_BY_COLUMN
+#define SQL_PARAM_DIAG_UNAVAILABLE 1
+#define SQL_PARAM_ERROR 5
+#define SQL_PARAM_IGNORE 1
+#define SQL_PARAM_PROCEED 0
+#define SQL_PARAM_SUCCESS 0
+#define SQL_PARAM_SUCCESS_WITH_INFO 6
+#define SQL_PARAM_UNUSED 7
+#define SQL_PARC_BATCH 1
+#define SQL_PARC_NO_BATCH 2
+#define SQL_PAS_BATCH 1
+#define SQL_PAS_NO_BATCH 2
+#define SQL_PAS_NO_SELECT 3
+#define SQL_ROW_IGNORE 1
+#define SQL_ROW_NUMBER_UNKNOWN (-2)
+#define SQL_ROW_PROCEED 0
+#define SQL_ROW_SUCCESS_WITH_INFO 6
+#define SQL_SC_FIPS127_2_TRANSITIONAL 0x00000002L
+#define SQL_SC_SQL92_ENTRY 0x00000001L
+#define SQL_SC_SQL92_FULL 0x00000008L
+#define SQL_SC_SQL92_INTERMEDIATE 0x00000004L
+#define SQL_SCC_ISO92_CLI 0x00000002L
+#define SQL_SCC_XOPEN_CLI_VERSION1 0x00000001L
+#define SQL_SCHEMA_TERM SQL_OWNER_TERM
+#define SQL_SCHEMA_USAGE SQL_OWNER_USAGE
+#define SQL_SDF_CURRENT_DATE 0x00000001L
+#define SQL_SDF_CURRENT_TIME 0x00000002L
+#define SQL_SDF_CURRENT_TIMESTAMP 0x00000004L
+#define SQL_SFKD_CASCADE 0x00000001L
+#define SQL_SFKD_NO_ACTION 0x00000002L
+#define SQL_SFKD_SET_DEFAULT 0x00000004L
+#define SQL_SFKD_SET_NULL 0x00000008L
+#define SQL_SFKU_CASCADE 0x00000001L
+#define SQL_SFKU_NO_ACTION 0x00000002L
+#define SQL_SFKU_SET_DEFAULT 0x00000004L
+#define SQL_SFKU_SET_NULL 0x00000008L
+#define SQL_SG_DELETE_TABLE 0x00000020L
+#define SQL_SG_INSERT_COLUMN 0x00000080L
+#define SQL_SG_INSERT_TABLE 0x00000040L
+#define SQL_SG_REFERENCES_COLUMN 0x00000200L
+#define SQL_SG_REFERENCES_TABLE 0x00000100L
+#define SQL_SG_SELECT_TABLE 0x00000400L
+#define SQL_SG_UPDATE_COLUMN 0x00001000L
+#define SQL_SG_UPDATE_TABLE 0x00000800L
+#define SQL_SG_USAGE_ON_CHARACTER_SET 0x00000002L
+#define SQL_SG_USAGE_ON_COLLATION 0x00000004L
+#define SQL_SG_USAGE_ON_DOMAIN 0x00000001L
+#define SQL_SG_USAGE_ON_TRANSLATION 0x00000008L
+#define SQL_SG_WITH_GRANT_OPTION 0x00000010L
+#define SQL_SNVF_BIT_LENGTH 0x00000001L
+#define SQL_SNVF_CHAR_LENGTH 0x00000002L
+#define SQL_SNVF_CHARACTER_LENGTH 0x00000004L
+#define SQL_SNVF_EXTRACT 0x00000008L
+#define SQL_SNVF_OCTET_LENGTH 0x00000010L
+#define SQL_SNVF_POSITION 0x00000020L
+#define SQL_SP_BETWEEN 0x00000800L
+#define SQL_SP_COMPARISON 0x00001000L
+#define SQL_SP_EXISTS 0x00000001L
+#define SQL_SP_IN 0x00000400L
+#define SQL_SP_ISNOTNULL 0x00000002L
+#define SQL_SP_ISNULL 0x00000004L
+#define SQL_SP_LIKE 0x00000200L
+#define SQL_SP_MATCH_FULL 0x00000008L
+#define SQL_SP_MATCH_PARTIAL 0x00000010L
+#define SQL_SP_MATCH_UNIQUE_FULL 0x00000020L
+#define SQL_SP_MATCH_UNIQUE_PARTIAL 0x00000040L
+#define SQL_SP_OVERLAPS 0x00000080L
+#define SQL_SP_QUANTIFIED_COMPARISON 0x00002000L
+#define SQL_SP_UNIQUE 0x00000100L
+#define SQL_SQL_CONFORMANCE 118
+#define SQL_SQL92_DATETIME_FUNCTIONS 155
+#define SQL_SQL92_FOREIGN_KEY_DELETE_RULE 156
+#define SQL_SQL92_FOREIGN_KEY_UPDATE_RULE 157
+#define SQL_SQL92_GRANT 158
+#define SQL_SQL92_NUMERIC_VALUE_FUNCTIONS 159
+#define SQL_SQL92_PREDICATES 160
+#define SQL_SQL92_RELATIONAL_JOIN_OPERATORS 161
+#define SQL_SQL92_REVOKE 162
+#define SQL_SQL92_ROW_VALUE_CONSTRUCTOR 163
+#define SQL_SQL92_STRING_FUNCTIONS 164
+#define SQL_SQL92_VALUE_EXPRESSIONS 165
+#define SQL_SR_CASCADE 0x00000020L
+#define SQL_SR_DELETE_TABLE 0x00000080L
+#define SQL_SR_GRANT_OPTION_FOR 0x00000010L
+#define SQL_SR_INSERT_COLUMN 0x00000200L
+#define SQL_SR_INSERT_TABLE 0x00000100L
+#define SQL_SR_REFERENCES_COLUMN 0x00000800L
+#define SQL_SR_REFERENCES_TABLE 0x00000400L
+#define SQL_SR_RESTRICT 0x00000040L
+#define SQL_SR_SELECT_TABLE 0x00001000L
+#define SQL_SR_UPDATE_COLUMN 0x00004000L
+#define SQL_SR_UPDATE_TABLE 0x00002000L
+#define SQL_SR_USAGE_ON_CHARACTER_SET 0x00000002L
+#define SQL_SR_USAGE_ON_COLLATION 0x00000004L
+#define SQL_SR_USAGE_ON_DOMAIN 0x00000001L
+#define SQL_SR_USAGE_ON_TRANSLATION 0x00000008L
+#define SQL_SRJO_CORRESPONDING_CLAUSE 0x00000001L
+#define SQL_SRJO_CROSS_JOIN 0x00000002L
+#define SQL_SRJO_EXCEPT_JOIN 0x00000004L
+#define SQL_SRJO_FULL_OUTER_JOIN 0x00000008L
+#define SQL_SRJO_INNER_JOIN 0x00000010L
+#define SQL_SRJO_INTERSECT_JOIN 0x00000020L
+#define SQL_SRJO_LEFT_OUTER_JOIN 0x00000040L
+#define SQL_SRJO_NATURAL_JOIN 0x00000080L
+#define SQL_SRJO_RIGHT_OUTER_JOIN 0x00000100L
+#define SQL_SRJO_UNION_JOIN 0x00000200L
+#define SQL_SRVC_DEFAULT 0x00000004L
+#define SQL_SRVC_NULL 0x00000002L
+#define SQL_SRVC_ROW_SUBQUERY 0x00000008L
+#define SQL_SRVC_VALUE_EXPRESSION 0x00000001L
+#define SQL_SSF_CONVERT 0x00000001L
+#define SQL_SSF_LOWER 0x00000002L
+#define SQL_SSF_SUBSTRING 0x00000008L
+#define SQL_SSF_TRANSLATE 0x00000010L
+#define SQL_SSF_TRIM_BOTH 0x00000020L
+#define SQL_SSF_TRIM_LEADING 0x00000040L
+#define SQL_SSF_TRIM_TRAILING 0x00000080L
+#define SQL_SSF_UPPER 0x00000004L
+#define SQL_STANDARD_CLI_CONFORMANCE 166
+#define SQL_STATIC_CURSOR_ATTRIBUTES1 167
+#define SQL_STATIC_CURSOR_ATTRIBUTES2 168
+#define SQL_SU_DML_STATEMENTS SQL_OU_DML_STATEMENTS
+#define SQL_SU_INDEX_DEFINITION SQL_OU_INDEX_DEFINITION
+#define SQL_SU_PRIVILEGE_DEFINITION SQL_OU_PRIVILEGE_DEFINITION
+#define SQL_SU_PROCEDURE_INVOCATION SQL_OU_PROCEDURE_INVOCATION
+#define SQL_SU_TABLE_DEFINITION SQL_OU_TABLE_DEFINITION
+#define SQL_SVE_CASE 0x00000001L
+#define SQL_SVE_CAST 0x00000002L
+#define SQL_SVE_COALESCE 0x00000004L
+#define SQL_SVE_NULLIF 0x00000008L
+#define SQL_UB_FIXED SQL_UB_ON
+#define SQL_UB_VARIABLE 2UL
+#define SQL_UNION_STATEMENT SQL_UNION
+#define SQL_UPDATE_BY_BOOKMARK 5
+#define SQL_US_UNION SQL_U_UNION
+#define SQL_US_UNION_ALL SQL_U_UNION_ALL
+#endif /* ODBCVER >= 0x300 */
+#if (ODBCVER >= 0x0350)
+#define SQL_DESC_ROWVER 35
+#define SQL_GUID (-11)
+#define SQL_C_GUID SQL_GUID
+#ifdef ODBC_STD
+#define SQLAllocHandle SQLAllocHandleStd
+#define SQLAllocEnv(p) SQLAllocHandleStd(SQL_HANDLE_ENV,SQL_NULL_HANDLE,p)
+#define SQL_YEAR SQL_CODE_YEAR
+#define SQL_MONTH SQL_CODE_MONTH
+#define SQL_DAY SQL_CODE_DAY
+#define SQL_HOUR SQL_CODE_HOUR
+#define SQL_MINUTE SQL_CODE_MINUTE
+#define SQL_SECOND SQL_CODE_SECOND
+#define SQL_YEAR_TO_MONTH SQL_CODE_YEAR_TO_MONTH
+#define SQL_DAY_TO_HOUR SQL_CODE_DAY_TO_HOUR
+#define SQL_DAY_TO_MINUTE SQL_CODE_DAY_TO_MINUTE
+#define SQL_DAY_TO_SECOND SQL_CODE_DAY_TO_SECOND
+#define SQL_HOUR_TO_MINUTE SQL_CODE_HOUR_TO_MINUTE
+#define SQL_HOUR_TO_SECOND SQL_CODE_HOUR_TO_SECOND
+#define SQL_MINUTE_TO_SECOND SQL_CODE_MINUTE_TO_SECOND
+#endif /* ODBC_STD */
+#endif /* ODBCVER >= 0x0350 */
+#if (ODBCVER >= 0x0351)
+#define SQL_ATTR_ANSI_APP 115
+#define SQL_AA_TRUE 1L
+#define SQL_AA_FALSE 0L
+#endif
+
+#define	TRACE_VERSION 1000
+#define TRACE_ON 1
+
+#ifndef RC_INVOKED
+#define SQL_ODBC_KEYWORDS \
+"ABSOLUTE,ACTION,ADA,ADD,ALL,ALLOCATE,ALTER,AND,ANY,ARE,AS,"\
+"ASC,ASSERTION,AT,AUTHORIZATION,AVG,"\
+"BEGIN,BETWEEN,BIT,BIT_LENGTH,BOTH,BY,CASCADE,CASCADED,CASE,CAST,CATALOG,"\
+"CHAR,CHAR_LENGTH,CHARACTER,CHARACTER_LENGTH,CHECK,CLOSE,COALESCE,"\
+"COLLATE,COLLATION,COLUMN,COMMIT,CONNECT,CONNECTION,CONSTRAINT,"\
+"CONSTRAINTS,CONTINUE,CONVERT,CORRESPONDING,COUNT,CREATE,CROSS,CURRENT,"\
+"CURRENT_DATE,CURRENT_TIME,CURRENT_TIMESTAMP,CURRENT_USER,CURSOR,"\
+"DATE,DAY,DEALLOCATE,DEC,DECIMAL,DECLARE,DEFAULT,DEFERRABLE,"\
+"DEFERRED,DELETE,DESC,DESCRIBE,DESCRIPTOR,DIAGNOSTICS,DISCONNECT,"\
+"DISTINCT,DOMAIN,DOUBLE,DROP,"\
+"ELSE,END,END-EXEC,ESCAPE,EXCEPT,EXCEPTION,EXEC,EXECUTE,"\
+"EXISTS,EXTERNAL,EXTRACT,"\
+"FALSE,FETCH,FIRST,FLOAT,FOR,FOREIGN,FORTRAN,FOUND,FROM,FULL,"\
+"GET,GLOBAL,GO,GOTO,GRANT,GROUP,HAVING,HOUR,"\
+"IDENTITY,IMMEDIATE,IN,INCLUDE,INDEX,INDICATOR,INITIALLY,INNER,"\
+"INPUT,INSENSITIVE,INSERT,INT,INTEGER,INTERSECT,INTERVAL,INTO,IS,ISOLATION,"\
+"JOIN,KEY,LANGUAGE,LAST,LEADING,LEFT,LEVEL,LIKE,LOCAL,LOWER,"\
+"MATCH,MAX,MIN,MINUTE,MODULE,MONTH,"\
+"NAMES,NATIONAL,NATURAL,NCHAR,NEXT,NO,NONE,NOT,NULL,NULLIF,NUMERIC,"\
+"OCTET_LENGTH,OF,ON,ONLY,OPEN,OPTION,OR,ORDER,OUTER,OUTPUT,OVERLAPS,"\
+"PAD,PARTIAL,PASCAL,PLI,POSITION,PRECISION,PREPARE,PRESERVE,"\
+"PRIMARY,PRIOR,PRIVILEGES,PROCEDURE,PUBLIC,"\
+"READ,REAL,REFERENCES,RELATIVE,RESTRICT,REVOKE,RIGHT,ROLLBACK,ROWS"\
+"SCHEMA,SCROLL,SECOND,SECTION,SELECT,SESSION,SESSION_USER,SET,SIZE,"\
+"SMALLINT,SOME,SPACE,SQL,SQLCA,SQLCODE,SQLERROR,SQLSTATE,SQLWARNING,"\
+"SUBSTRING,SUM,SYSTEM_USER,"\
+"TABLE,TEMPORARY,THEN,TIME,TIMESTAMP,TIMEZONE_HOUR,TIMEZONE_MINUTE,"\
+"TO,TRAILING,TRANSACTION,TRANSLATE,TRANSLATION,TRIM,TRUE,"\
+"UNION,UNIQUE,UNKNOWN,UPDATE,UPPER,USAGE,USER,USING,"\
+"VALUE,VALUES,VARCHAR,VARYING,VIEW,WHEN,WHENEVER,WHERE,WITH,WORK,WRITE,"\
+"YEAR,ZONE"
+
+SQLRETURN SQL_API SQLDriverConnect(SQLHDBC,SQLHWND,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLSMALLINT*,SQLUSMALLINT);
+SQLRETURN SQL_API SQLBrowseConnect(SQLHDBC,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLSMALLINT*);
+SQLRETURN SQL_API SQLColumnPrivileges(SQLHSTMT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT);
+SQLRETURN SQL_API SQLColAttributes(SQLHSTMT,SQLUSMALLINT, SQLUSMALLINT, SQLPOINTER, SQLSMALLINT, SQLSMALLINT*, SQLLEN*);
+SQLRETURN SQL_API SQLDescribeParam(SQLHSTMT,SQLUSMALLINT,SQLSMALLINT*,SQLULEN*,SQLSMALLINT*,SQLSMALLINT*);
+SQLRETURN SQL_API SQLExtendedFetch(SQLHSTMT,SQLUSMALLINT,SQLINTEGER,SQLUINTEGER*,SQLUSMALLINT*);
+SQLRETURN SQL_API SQLForeignKeys(SQLHSTMT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT);
+SQLRETURN SQL_API SQLMoreResults(SQLHSTMT);
+SQLRETURN SQL_API SQLNativeSql(SQLHDBC,SQLCHAR*,SQLINTEGER,SQLCHAR*,SQLINTEGER,SQLINTEGER*);
+SQLRETURN SQL_API SQLNumParams(SQLHSTMT,SQLSMALLINT*);
+SQLRETURN SQL_API SQLParamOptions(SQLHSTMT,SQLUINTEGER,SQLUINTEGER*);
+SQLRETURN SQL_API SQLPrimaryKeys(SQLHSTMT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT);
+SQLRETURN SQL_API SQLProcedureColumns(SQLHSTMT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT);
+SQLRETURN SQL_API SQLProcedures(SQLHSTMT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT);
+SQLRETURN SQL_API SQLSetPos(SQLHSTMT,SQLUSMALLINT,SQLUSMALLINT,SQLUSMALLINT);
+SQLRETURN SQL_API SQLTablePrivileges(SQLHSTMT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT);
+SQLRETURN SQL_API SQLDrivers(SQLHENV,SQLUSMALLINT,SQLCHAR*,SQLSMALLINT,SQLSMALLINT*,SQLCHAR*,SQLSMALLINT,SQLSMALLINT*);
+SQLRETURN SQL_API SQLBindParameter(SQLHSTMT,SQLUSMALLINT,SQLSMALLINT,SQLSMALLINT,SQLSMALLINT,SQLULEN,SQLSMALLINT,SQLPOINTER,SQLLEN,SQLLEN*);
+SQLRETURN SQL_API SQLSetScrollOptions(SQLHSTMT,SQLUSMALLINT,SQLLEN,SQLUSMALLINT); /* deprecated */
+DWORD SQL_API ODBCGetTryWaitValue(void);
+BOOL SQL_API ODBCSetTryWaitValue(DWORD);
+RETCODE	SQL_API TraceOpenLogFile(LPWSTR,LPWSTR,DWORD);
+RETCODE	SQL_API TraceCloseLogFile(void);
+VOID SQL_API TraceReturn(RETCODE,RETCODE);
+DWORD SQL_API TraceVersion(void);
+#if (ODBCVER >= 0x0300)
+SQLRETURN SQL_API SQLBulkOperations(SQLHSTMT,SQLSMALLINT);
+SQLRETURN SQL_API SQLAllocHandleStd( SQLSMALLINT,SQLHANDLE,SQLHANDLE*);
+#endif
+#endif /* ndef RC_INVOKED */
+#include <sqlucode.h>
+#ifdef __cplusplus
+}
+#endif
+#endif
diff -Nur tcc-0.9.26.orig/win32/include/sql.h tcc-0.9.26/win32/include/sql.h
--- tcc-0.9.26.orig/win32/include/sql.h	1970-01-01 01:00:00.000000000 +0100
+++ tcc-0.9.26/win32/include/sql.h	2013-11-03 08:29:45.000000000 +0100
@@ -0,0 +1,408 @@
+#ifndef _SQL_H
+#define _SQL_H
+#if __GNUC__ >=3
+#pragma GCC system_header
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+#ifndef ODBCVER
+#define ODBCVER 0x0351
+#endif
+#include <sqltypes.h>
+#define SQL_ACCESSIBLE_PROCEDURES 20
+#define SQL_ACCESSIBLE_TABLES 19
+#define SQL_ALL_TYPES 0
+#define SQL_ALTER_TABLE 86
+#define SQL_API_SQLALLOCCONNECT 1
+#define SQL_API_SQLALLOCENV 2
+#define SQL_API_SQLALLOCSTMT 3
+#define SQL_API_SQLBINDCOL 4
+#define SQL_API_SQLCANCEL 5
+#define SQL_API_SQLCOLUMNS 40
+#define SQL_API_SQLCONNECT 7
+#define SQL_API_SQLDATASOURCES 57
+#define SQL_API_SQLDESCRIBECOL 8
+#define SQL_API_SQLDISCONNECT 9
+#define SQL_API_SQLERROR 10
+#define SQL_API_SQLEXECDIRECT 11
+#define SQL_API_SQLEXECUTE 12
+#define SQL_API_SQLFETCH 13
+#define SQL_API_SQLFREECONNECT 14
+#define SQL_API_SQLFREEENV 15
+#define SQL_API_SQLFREESTMT 16
+#define SQL_API_SQLGETCONNECTOPTION 42
+#define SQL_API_SQLGETCURSORNAME 17
+#define SQL_API_SQLGETDATA 43
+#define SQL_API_SQLGETFUNCTIONS 44
+#define SQL_API_SQLGETINFO 45
+#define SQL_API_SQLGETSTMTOPTION 46
+#define SQL_API_SQLGETTYPEINFO 47
+#define SQL_API_SQLNUMRESULTCOLS 18
+#define SQL_API_SQLPARAMDATA 48
+#define SQL_API_SQLPREPARE 19
+#define SQL_API_SQLPUTDATA 49
+#define SQL_API_SQLROWCOUNT 20
+#define SQL_API_SQLSETCONNECTOPTION 50
+#define SQL_API_SQLSETCURSORNAME 21
+#define SQL_API_SQLSETPARAM 22
+#define SQL_API_SQLSETSTMTOPTION 51
+#define SQL_API_SQLSPECIALCOLUMNS 52
+#define SQL_API_SQLSTATISTICS 53
+#define SQL_API_SQLTABLES 54
+#define SQL_API_SQLTRANSACT 23
+#define SQL_CB_CLOSE 1
+#define SQL_CB_DELETE 0
+#define SQL_CB_PRESERVE 2
+#define SQL_CHAR 1
+#define SQL_CLOSE 0
+#define SQL_COMMIT 0
+#define SQL_CURSOR_COMMIT_BEHAVIOR 23
+#define SQL_DATA_AT_EXEC (-2)
+#define SQL_DATA_SOURCE_NAME 2
+#define SQL_DATA_SOURCE_READ_ONLY 25
+#define SQL_DBMS_NAME 17
+#define SQL_DBMS_VER 18
+#define SQL_DECIMAL 3
+#define SQL_DEFAULT_TXN_ISOLATION 26
+#define SQL_DOUBLE 8
+#define SQL_DROP 1
+#define SQL_ERROR (-1)
+#define SQL_FD_FETCH_ABSOLUTE 16
+#define SQL_FD_FETCH_FIRST 2
+#define SQL_FD_FETCH_LAST 4
+#define SQL_FD_FETCH_NEXT 1
+#define SQL_FD_FETCH_PRIOR 8
+#define SQL_FD_FETCH_RELATIVE 32
+#define SQL_FETCH_ABSOLUTE 5
+#define SQL_FETCH_DIRECTION 8
+#define SQL_FETCH_FIRST 2
+#define SQL_FETCH_LAST 3
+#define SQL_FETCH_NEXT 1
+#define SQL_FETCH_PRIOR 4
+#define SQL_FETCH_RELATIVE 6
+#define SQL_FLOAT 6
+#define SQL_GD_ANY_COLUMN 1
+#define SQL_GD_ANY_ORDER 2
+#define SQL_GETDATA_EXTENSIONS 81
+#define SQL_IC_LOWER 2
+#define SQL_IC_MIXED 4
+#define SQL_IC_SENSITIVE 3
+#define SQL_IC_UPPER 1
+#define SQL_IDENTIFIER_CASE 28
+#define SQL_IDENTIFIER_QUOTE_CHAR 29
+#define SQL_INDEX_ALL 1
+#define SQL_INDEX_CLUSTERED 1
+#define SQL_INDEX_HASHED 2
+#define SQL_INDEX_OTHER 3
+#define SQL_INDEX_UNIQUE 0
+#define SQL_INTEGER 4
+#define SQL_INTEGRITY 73
+#define SQL_INVALID_HANDLE (-2)
+#define SQL_MAX_CATALOG_NAME_LEN 34
+#define SQL_MAX_COLUMN_NAME_LEN 30
+#define SQL_MAX_COLUMNS_IN_GROUP_BY 97
+#define SQL_MAX_COLUMNS_IN_INDEX 98
+#define SQL_MAX_COLUMNS_IN_ORDER_BY 99
+#define SQL_MAX_COLUMNS_IN_SELECT 100
+#define SQL_MAX_COLUMNS_IN_TABLE 101
+#define SQL_MAX_CURSOR_NAME_LEN 31
+#define SQL_MAX_INDEX_SIZE 102
+#define SQL_MAX_MESSAGE_LENGTH 512
+#define SQL_MAX_ROW_SIZE 104
+#define SQL_MAX_SCHEMA_NAME_LEN 32
+#define SQL_MAX_STATEMENT_LEN 105
+#define SQL_MAX_TABLE_NAME_LEN 35
+#define SQL_MAX_TABLES_IN_SELECT 106
+#define SQL_MAX_USER_NAME_LEN 107
+#define SQL_MAXIMUM_CATALOG_NAME_LENGTH SQL_MAX_CATALOG_NAME_LEN
+#define SQL_MAXIMUM_COLUMN_NAME_LENGTH SQL_MAX_COLUMN_NAME_LEN
+#define SQL_MAXIMUM_COLUMNS_IN_GROUP_BY SQL_MAX_COLUMNS_IN_GROUP_BY
+#define SQL_MAXIMUM_COLUMNS_IN_INDEX SQL_MAX_COLUMNS_IN_INDEX
+#define SQL_MAXIMUM_COLUMNS_IN_ORDER_BY SQL_MAX_COLUMNS_IN_ORDER_BY
+#define SQL_MAXIMUM_COLUMNS_IN_SELECT SQL_MAX_COLUMNS_IN_SELECT
+#define SQL_MAXIMUM_CURSOR_NAME_LENGTH SQL_MAX_CURSOR_NAME_LEN
+#define SQL_MAXIMUM_INDEX_SIZE SQL_MAX_INDEX_SIZE
+#define SQL_MAXIMUM_ROW_SIZE SQL_MAX_ROW_SIZE
+#define SQL_MAXIMUM_SCHEMA_NAME_LENGTH SQL_MAX_SCHEMA_NAME_LEN
+#define SQL_MAXIMUM_STATEMENT_LENGTH SQL_MAX_STATEMENT_LEN
+#define SQL_MAXIMUM_TABLES_IN_SELECT SQL_MAX_TABLES_IN_SELECT
+#define SQL_MAXIMUM_USER_NAME_LENGTH SQL_MAX_USER_NAME_LEN
+#define SQL_NC_HIGH 0
+#define SQL_NC_LOW 1
+#define SQL_NEED_DATA 99
+#define SQL_NO_NULLS 0
+#define SQL_NTS (-3)
+#define SQL_NTSL (-3L)
+#define SQL_NULL_COLLATION 85
+#define SQL_NULL_DATA (-1)
+#define SQL_NULL_HDBC 0
+#define SQL_NULL_HENV 0
+#define SQL_NULL_HSTMT 0
+#define SQL_NULLABLE 1
+#define SQL_NULLABLE_UNKNOWN 2
+#define SQL_NUMERIC 2
+#define SQL_ORDER_BY_COLUMNS_IN_SELECT 90
+#define SQL_PC_PSEUDO 2
+#define SQL_PC_UNKNOWN 0
+#define SQL_REAL 7
+#define SQL_RESET_PARAMS 3
+#define SQL_ROLLBACK 1
+#define SQL_SCCO_LOCK 2
+#define SQL_SCCO_OPT_ROWVER 4
+#define SQL_SCCO_OPT_VALUES 8
+#define SQL_SCCO_READ_ONLY 1
+#define SQL_SCOPE_CURROW 0
+#define SQL_SCOPE_SESSION 2
+#define SQL_SCOPE_TRANSACTION 1
+#define SQL_SCROLL_CONCURRENCY 43
+#define SQL_SEARCH_PATTERN_ESCAPE 14
+#define SQL_SERVER_NAME 13
+#define SQL_SMALLINT 5
+#define SQL_SPECIAL_CHARACTERS 94
+#define SQL_STILL_EXECUTING 2
+#define SQL_SUCCEEDED(rc) (((rc)&(~1))==0)
+#define SQL_SUCCESS 0
+#define SQL_SUCCESS_WITH_INFO 1
+#define SQL_TC_ALL 2
+#define SQL_TC_DDL_COMMIT 3
+#define SQL_TC_DDL_IGNORE 4
+#define SQL_TC_DML 1
+#define SQL_TC_NONE 0
+#define SQL_TRANSACTION_CAPABLE SQL_TXN_CAPABLE
+#define SQL_TRANSACTION_ISOLATION_OPTION SQL_TXN_ISOLATION_OPTION
+#define SQL_TRANSACTION_READ_COMMITTED SQL_TXN_READ_COMMITTED
+#define SQL_TRANSACTION_READ_UNCOMMITTED SQL_TXN_READ_UNCOMMITTED
+#define SQL_TRANSACTION_REPEATABLE_READ SQL_TXN_REPEATABLE_READ
+#define SQL_TRANSACTION_SERIALIZABLE SQL_TXN_SERIALIZABLE
+#define SQL_TXN_CAPABLE 46
+#define SQL_TXN_ISOLATION_OPTION 72
+#define SQL_TXN_READ_COMMITTED 2
+#define SQL_TXN_READ_UNCOMMITTED 1
+#define SQL_TXN_REPEATABLE_READ 4
+#define SQL_TXN_SERIALIZABLE 8
+#define SQL_UNBIND 2
+#define SQL_UNKNOWN_TYPE 0
+#define SQL_USER_NAME 47
+#define SQL_VARCHAR 12
+#if (ODBCVER >= 0x0200)
+#define SQL_AT_ADD_COLUMN 1
+#define SQL_AT_DROP_COLUMN 2
+#endif /* ODBCVER >= 0x0200 */
+#if (ODBCVER >= 0x0201)
+#define SQL_OJ_LEFT 1
+#define SQL_OJ_RIGHT 2
+#define SQL_OJ_FULL 4
+#define SQL_OJ_NESTED 8
+#define SQL_OJ_NOT_ORDERED 16
+#define SQL_OJ_INNER 32
+#define SQL_OJ_ALL_COMPARISON_OPS 64
+#endif /* ODBCVER >= 0x0201 */ 
+#if (ODBCVER >= 0x0300)   
+#define SQL_AM_CONNECTION 1
+#define SQL_AM_NONE 0
+#define SQL_AM_STATEMENT 2
+#define SQL_API_SQLALLOCHANDLE 1001
+#define SQL_API_SQLBINDPARAM 1002
+#define SQL_API_SQLCLOSECURSOR 1003
+#define SQL_API_SQLCOLATTRIBUTE 6
+#define SQL_API_SQLCOPYDESC 1004
+#define SQL_API_SQLENDTRAN 1005
+#define SQL_API_SQLFETCHSCROLL 1021
+#define SQL_API_SQLFREEHANDLE 1006
+#define SQL_API_SQLGETCONNECTATTR 1007
+#define SQL_API_SQLGETDESCFIELD 1008
+#define SQL_API_SQLGETDESCREC 1009
+#define SQL_API_SQLGETDIAGFIELD 1010
+#define SQL_API_SQLGETDIAGREC 1011
+#define SQL_API_SQLGETENVATTR 1012
+#define SQL_API_SQLGETSTMTATTR 1014
+#define SQL_API_SQLSETCONNECTATTR 1016
+#define SQL_API_SQLSETDESCFIELD 1017
+#define SQL_API_SQLSETDESCREC 1018
+#define SQL_API_SQLSETENVATTR 1019
+#define SQL_API_SQLSETSTMTATTR 1020
+#define SQL_ARD_TYPE (-99)
+#define SQL_AT_ADD_CONSTRAINT 8
+#define SQL_ATTR_APP_PARAM_DESC 10011
+#define SQL_ATTR_APP_ROW_DESC 10010
+#define SQL_ATTR_AUTO_IPD 10001
+#define SQL_ATTR_CURSOR_SCROLLABLE (-1)
+#define SQL_ATTR_CURSOR_SENSITIVITY (-2)
+#define SQL_ATTR_IMP_PARAM_DESC 10013
+#define SQL_ATTR_IMP_ROW_DESC 10012
+#define SQL_ATTR_METADATA_ID 10014
+#define SQL_ATTR_OUTPUT_NTS 10001
+#define SQL_CATALOG_NAME 10003
+#define SQL_CODE_DATE 1
+#define SQL_CODE_TIME 2
+#define SQL_CODE_TIMESTAMP 3
+#define SQL_COLLATION_SEQ 10004
+#define SQL_CURSOR_SENSITIVITY 10001
+#define SQL_DATE_LEN 10
+#define SQL_DATETIME 9
+#define SQL_DEFAULT 99
+#define SQL_DESC_ALLOC_AUTO 1
+#define SQL_DESC_ALLOC_TYPE 1099
+#define SQL_DESC_ALLOC_USER 2
+#define SQL_DESC_COUNT 1001
+#define SQL_DESC_DATA_PTR 1010
+#define SQL_DESC_DATETIME_INTERVAL_CODE 1007
+#define SQL_DESC_INDICATOR_PTR 1009
+#define SQL_DESC_LENGTH 1003
+#define SQL_DESC_NAME 1011
+#define SQL_DESC_NULLABLE 1008
+#define SQL_DESC_OCTET_LENGTH 1013
+#define SQL_DESC_OCTET_LENGTH_PTR 1004
+#define SQL_DESC_PRECISION 1005
+#define SQL_DESC_SCALE 1006
+#define SQL_DESC_TYPE 1002
+#define SQL_DESC_UNNAMED 1012
+#define SQL_DESCRIBE_PARAMETER 10002
+#define SQL_DIAG_ALTER_DOMAIN 3
+#define SQL_DIAG_ALTER_TABLE 4
+#define SQL_DIAG_CALL 7
+#define SQL_DIAG_CLASS_ORIGIN 8
+#define SQL_DIAG_CONNECTION_NAME 10
+#define SQL_DIAG_CREATE_ASSERTION 6
+#define SQL_DIAG_CREATE_CHARACTER_SET 8
+#define SQL_DIAG_CREATE_COLLATION 10
+#define SQL_DIAG_CREATE_DOMAIN 23
+#define SQL_DIAG_CREATE_INDEX (-1)
+#define SQL_DIAG_CREATE_SCHEMA 64
+#define SQL_DIAG_CREATE_TABLE 77
+#define SQL_DIAG_CREATE_TRANSLATION 79
+#define SQL_DIAG_CREATE_VIEW 84
+#define SQL_DIAG_DELETE_WHERE 19
+#define SQL_DIAG_DROP_ASSERTION 24
+#define SQL_DIAG_DROP_CHARACTER_SET 25
+#define SQL_DIAG_DROP_COLLATION 26
+#define SQL_DIAG_DROP_DOMAIN 27
+#define SQL_DIAG_DROP_INDEX (-2)
+#define SQL_DIAG_DROP_SCHEMA 31
+#define SQL_DIAG_DROP_TABLE 32
+#define SQL_DIAG_DROP_TRANSLATION 33
+#define SQL_DIAG_DROP_VIEW 36
+#define SQL_DIAG_DYNAMIC_DELETE_CURSOR 38
+#define SQL_DIAG_DYNAMIC_FUNCTION 7
+#define SQL_DIAG_DYNAMIC_FUNCTION_CODE 12
+#define SQL_DIAG_DYNAMIC_UPDATE_CURSOR 81
+#define SQL_DIAG_GRANT 48
+#define SQL_DIAG_INSERT 50
+#define SQL_DIAG_MESSAGE_TEXT 6
+#define SQL_DIAG_NATIVE 5
+#define SQL_DIAG_NUMBER 2
+#define SQL_DIAG_RETURNCODE 1
+#define SQL_DIAG_REVOKE 59
+#define SQL_DIAG_ROW_COUNT 3
+#define SQL_DIAG_SELECT_CURSOR 85
+#define SQL_DIAG_SERVER_NAME 11
+#define SQL_DIAG_SQLSTATE 4
+#define SQL_DIAG_SUBCLASS_ORIGIN 9
+#define SQL_DIAG_UNKNOWN_STATEMENT 0
+#define SQL_DIAG_UPDATE_WHERE 82
+#define SQL_FALSE 0
+#define SQL_HANDLE_DBC 2
+#define SQL_HANDLE_DESC 4
+#define SQL_HANDLE_ENV 1
+#define SQL_HANDLE_STMT 3
+#define SQL_INSENSITIVE 1
+#define SQL_MAX_CONCURRENT_ACTIVITIES 1
+#define SQL_MAX_DRIVER_CONNECTIONS 0
+#define SQL_MAX_IDENTIFIER_LEN 10005
+#define SQL_MAXIMUM_CONCURRENT_ACTIVITIES SQL_MAX_CONCURRENT_ACTIVITIES
+#define SQL_MAXIMUM_DRIVER_CONNECTIONS SQL_MAX_DRIVER_CONNECTIONS
+#define SQL_MAXIMUM_IDENTIFIER_LENGTH SQL_MAX_IDENTIFIER_LEN
+#define SQL_NAMED 0
+#define SQL_NO_DATA 100
+#define SQL_NONSCROLLABLE 0
+#define SQL_NULL_HANDLE 0L
+#define SQL_NULL_HDESC 0
+#define SQL_OJ_CAPABILITIES 115
+#define SQL_OUTER_JOIN_CAPABILITIES SQL_OJ_CAPABILITIES
+#define SQL_PC_NON_PSEUDO 1
+#define SQL_PRED_BASIC 2
+#define SQL_PRED_CHAR 1
+#define SQL_PRED_NONE 0
+#define SQL_ROW_IDENTIFIER 1
+#define SQL_SCROLLABLE 1
+#define SQL_SENSITIVE 2
+#define SQL_TIME_LEN 8
+#define SQL_TIMESTAMP_LEN 19
+#define SQL_TRUE 1
+#define SQL_TYPE_DATE 91
+#define SQL_TYPE_TIME 92
+#define SQL_TYPE_TIMESTAMP 93
+#define SQL_UNNAMED 1
+#define SQL_UNSPECIFIED 0
+#define SQL_XOPEN_CLI_YEAR 10000
+#endif /* ODBCVER >= 0x0300 */
+
+#ifndef RC_INVOKED
+SQLRETURN SQL_API SQLAllocConnect(SQLHENV,SQLHDBC*); /* deprecated */
+SQLRETURN SQL_API SQLAllocEnv(SQLHENV*); /* deprecated */
+SQLRETURN SQL_API SQLAllocStmt(SQLHDBC,SQLHSTMT*); /* deprecated */
+SQLRETURN SQL_API SQLBindCol(SQLHSTMT,SQLUSMALLINT,SQLSMALLINT,SQLPOINTER,SQLLEN,SQLLEN*);
+SQLRETURN SQL_API SQLCancel(SQLHSTMT);
+SQLRETURN SQL_API SQLConnect(SQLHDBC,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT);
+SQLRETURN SQL_API SQLDescribeCol(SQLHSTMT,SQLUSMALLINT,SQLCHAR*,SQLSMALLINT,SQLSMALLINT*,SQLSMALLINT*,SQLULEN*,SQLSMALLINT*,SQLSMALLINT*);
+SQLRETURN SQL_API SQLDisconnect(SQLHDBC);
+SQLRETURN SQL_API SQLError(SQLHENV,SQLHDBC,SQLHSTMT,SQLCHAR*,SQLINTEGER*,SQLCHAR*,SQLSMALLINT,SQLSMALLINT*); /* deprecated */
+SQLRETURN SQL_API SQLExecDirect(SQLHSTMT,SQLCHAR*,SQLINTEGER);
+SQLRETURN SQL_API SQLExecute(SQLHSTMT);
+SQLRETURN SQL_API SQLFetch(SQLHSTMT);
+SQLRETURN SQL_API SQLFreeConnect(SQLHDBC); /* deprecated */
+SQLRETURN SQL_API SQLFreeEnv(SQLHENV); /* deprecated */
+SQLRETURN SQL_API SQLFreeStmt(SQLHSTMT,SQLUSMALLINT); 
+SQLRETURN SQL_API SQLGetCursorName(SQLHSTMT,SQLCHAR*,SQLSMALLINT,SQLSMALLINT*);
+SQLRETURN SQL_API SQLNumResultCols(SQLHSTMT,SQLSMALLINT*);
+SQLRETURN SQL_API SQLPrepare(SQLHSTMT,SQLCHAR*,SQLINTEGER);
+SQLRETURN SQL_API SQLRowCount(SQLHSTMT,SQLLEN*);
+SQLRETURN SQL_API SQLSetCursorName(SQLHSTMT,SQLCHAR*,SQLSMALLINT);
+SQLRETURN SQL_API SQLTransact(SQLHENV,SQLHDBC,SQLUSMALLINT);
+SQLRETURN SQL_API SQLSetParam(SQLHSTMT,SQLUSMALLINT,SQLSMALLINT,SQLSMALLINT,SQLULEN,SQLSMALLINT,SQLPOINTER,SQLLEN*); /* deprecated */
+SQLRETURN SQL_API SQLColumns(SQLHSTMT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT);
+SQLRETURN SQL_API SQLGetConnectOption(SQLHDBC,SQLUSMALLINT,SQLPOINTER); /* deprecated */
+SQLRETURN SQL_API SQLGetData(SQLHSTMT,SQLUSMALLINT,SQLSMALLINT,SQLPOINTER,SQLLEN,SQLLEN*);
+SQLRETURN SQL_API SQLGetFunctions(SQLHDBC,SQLUSMALLINT,SQLUSMALLINT*);
+SQLRETURN SQL_API SQLGetInfo(SQLHDBC,SQLUSMALLINT,SQLPOINTER,SQLSMALLINT,SQLSMALLINT*);
+SQLRETURN SQL_API SQLGetStmtOption(SQLHSTMT,SQLUSMALLINT,SQLPOINTER); /* deprecated */
+SQLRETURN SQL_API SQLGetTypeInfo(SQLHSTMT,SQLSMALLINT);
+SQLRETURN SQL_API SQLParamData(SQLHSTMT,SQLPOINTER*);
+SQLRETURN SQL_API SQLPutData(SQLHSTMT,SQLPOINTER,SQLLEN);
+SQLRETURN SQL_API SQLSetConnectOption(SQLHDBC,SQLUSMALLINT,SQLULEN); /* deprecated */
+SQLRETURN SQL_API SQLSetStmtOption(SQLHSTMT,SQLUSMALLINT,SQLROWCOUNT); /* deprecated */
+SQLRETURN SQL_API SQLSpecialColumns(SQLHSTMT,SQLUSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLUSMALLINT,SQLUSMALLINT);
+SQLRETURN SQL_API SQLStatistics(SQLHSTMT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLUSMALLINT,SQLUSMALLINT);
+SQLRETURN SQL_API SQLTables(SQLHSTMT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT);
+SQLRETURN SQL_API SQLDataSources(SQLHENV,SQLUSMALLINT,SQLCHAR*,SQLSMALLINT,SQLSMALLINT*,SQLCHAR*,SQLSMALLINT,SQLSMALLINT*);
+#if (ODBCVER >= 0x0300)
+SQLRETURN SQL_API SQLAllocHandle(SQLSMALLINT,SQLHANDLE,SQLHANDLE*);
+SQLRETURN SQL_API SQLBindParam(SQLHSTMT,SQLUSMALLINT,SQLSMALLINT,SQLSMALLINT,SQLULEN,SQLSMALLINT,SQLPOINTER,SQLLEN*);
+SQLRETURN SQL_API SQLCloseCursor(SQLHSTMT); 
+SQLRETURN SQL_API SQLColAttribute(SQLHSTMT,SQLUSMALLINT,SQLUSMALLINT,SQLPOINTER,SQLSMALLINT,SQLSMALLINT*,SQLPOINTER);
+SQLRETURN SQL_API SQLCopyDesc(SQLHDESC,SQLHDESC);
+SQLRETURN SQL_API SQLEndTran(SQLSMALLINT,SQLHANDLE,SQLSMALLINT);
+SQLRETURN SQL_API SQLFetchScroll(SQLHSTMT,SQLSMALLINT,SQLROWOFFSET);
+SQLRETURN SQL_API SQLFreeHandle(SQLSMALLINT,SQLHANDLE);
+SQLRETURN SQL_API SQLGetConnectAttr(SQLHDBC,SQLINTEGER,SQLPOINTER,SQLINTEGER,SQLINTEGER*);
+SQLRETURN SQL_API SQLGetDescField(SQLHDESC,SQLSMALLINT,SQLSMALLINT,SQLPOINTER,SQLINTEGER,SQLINTEGER*); 
+SQLRETURN SQL_API SQLGetDescRec(SQLHDESC,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLSMALLINT*,
+    SQLSMALLINT*,SQLSMALLINT*,SQLLEN*,SQLSMALLINT*,SQLSMALLINT*,SQLSMALLINT*); 
+SQLRETURN SQL_API SQLGetDiagField(SQLSMALLINT,SQLHANDLE,SQLSMALLINT,SQLSMALLINT,SQLPOINTER,SQLSMALLINT,SQLSMALLINT*); 
+SQLRETURN SQL_API SQLGetDiagRec(SQLSMALLINT,SQLHANDLE,SQLSMALLINT,SQLCHAR*,SQLINTEGER*,SQLCHAR*,SQLSMALLINT,SQLSMALLINT*); 
+SQLRETURN SQL_API SQLGetEnvAttr(SQLHENV,SQLINTEGER,SQLPOINTER,SQLINTEGER,SQLINTEGER*);
+SQLRETURN SQL_API SQLGetStmtAttr(SQLHSTMT,SQLINTEGER,SQLPOINTER,SQLINTEGER,SQLINTEGER*);
+SQLRETURN SQL_API SQLSetConnectAttr(SQLHDBC,SQLINTEGER,SQLPOINTER,SQLINTEGER);
+SQLRETURN SQL_API SQLSetDescField(SQLHDESC,SQLSMALLINT,SQLSMALLINT,SQLPOINTER,SQLINTEGER); 
+SQLRETURN SQL_API SQLSetDescRec(SQLHDESC,SQLSMALLINT,SQLSMALLINT,SQLSMALLINT,SQLLEN,SQLSMALLINT,
+    SQLSMALLINT,SQLPOINTER,SQLLEN*,SQLLEN*); 
+SQLRETURN SQL_API SQLSetEnvAttr(SQLHENV,SQLINTEGER,SQLPOINTER,SQLINTEGER);
+SQLRETURN SQL_API SQLSetStmtAttr(SQLHSTMT,SQLINTEGER,SQLPOINTER,SQLINTEGER);
+#endif  /* (ODBCVER >= 0x0300) */
+#endif /* ndef RC_INVOKED */
+#ifdef __cplusplus
+}
+#endif
+#endif
diff -Nur tcc-0.9.26.orig/win32/include/sqltypes.h tcc-0.9.26/win32/include/sqltypes.h
--- tcc-0.9.26.orig/win32/include/sqltypes.h	1970-01-01 01:00:00.000000000 +0100
+++ tcc-0.9.26/win32/include/sqltypes.h	2013-11-03 08:29:45.000000000 +0100
@@ -0,0 +1,165 @@
+#ifndef _SQLTYPES_H
+#define _SQLTYPES_H
+#if __GNUC__ >=3
+#pragma GCC system_header
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+#define SQL_API __stdcall
+#ifndef RC_INVOKED
+#define __need_wchar_t
+#include <stddef.h>
+typedef signed char SCHAR;
+typedef long SDWORD;
+typedef short SWORD;
+typedef ULONG UDWORD;
+typedef USHORT UWORD;
+typedef signed long SLONG;
+typedef signed short SSHORT;
+typedef double SDOUBLE;
+typedef double LDOUBLE;
+typedef float SFLOAT;
+typedef PVOID PTR;
+typedef PVOID HENV;
+typedef PVOID HDBC;
+typedef PVOID HSTMT;
+typedef short RETCODE;
+typedef UCHAR SQLCHAR;
+typedef SCHAR SQLSCHAR;
+typedef SDWORD SQLINTEGER;
+typedef SWORD SQLSMALLINT;
+#ifndef __WIN64
+typedef UDWORD SQLUINTEGER;
+#endif
+typedef UWORD SQLUSMALLINT;
+typedef PVOID SQLPOINTER;
+#if (ODBCVER >= 0x0300)
+typedef void* SQLHANDLE;
+typedef SQLHANDLE SQLHENV;
+typedef SQLHANDLE SQLHDBC;
+typedef SQLHANDLE SQLHSTMT;
+typedef SQLHANDLE SQLHDESC;
+#else
+typedef void* SQLHENV;
+typedef void* SQLHDBC;
+typedef void* SQLHSTMT;
+#endif
+typedef SQLSMALLINT SQLRETURN;
+typedef HWND SQLHWND;
+typedef ULONG BOOKMARK;
+#ifdef _WIN64
+typedef INT64 SQLLEN;
+typedef INT64 SQLROWOFFSET;
+typedef UINT64 SQLROWCOUNT;
+typedef UINT64 SQLULEN;
+typedef UINT64 SQLTRANSID;
+typedef unsigned long SQLSETPOSIROW;
+#else
+#define SQLLEN SQLINTEGER
+#define SQLROWOFFSET SQLINTEGER
+#define SQLROWCOUNT SQLUINTEGER
+#define SQLULEN SQLUINTEGER
+#define SQLTRANSID DWORD
+#define SQLSETPOSIROW SQLUSMALLINT
+#endif
+typedef wchar_t SQLWCHAR;
+#ifdef UNICODE
+typedef SQLWCHAR        SQLTCHAR;
+#else
+typedef SQLCHAR         SQLTCHAR;
+#endif  /* UNICODE */
+#if (ODBCVER >= 0x0300)
+typedef unsigned char   SQLDATE;
+typedef unsigned char   SQLDECIMAL;
+typedef double          SQLDOUBLE;
+typedef double          SQLFLOAT;
+typedef unsigned char   SQLNUMERIC;
+typedef float           SQLREAL;
+typedef unsigned char   SQLTIME;
+typedef unsigned char   SQLTIMESTAMP;
+typedef unsigned char   SQLVARCHAR;
+#define ODBCINT64	__int64
+typedef __int64 SQLBIGINT;
+typedef unsigned __int64 SQLUBIGINT;
+#endif
+
+typedef struct tagDATE_STRUCT {
+	SQLSMALLINT year;
+	SQLUSMALLINT month;
+	SQLUSMALLINT day;
+} DATE_STRUCT;
+typedef struct tagTIME_STRUCT {
+	SQLUSMALLINT hour;
+	SQLUSMALLINT minute;
+	SQLUSMALLINT second;
+} TIME_STRUCT;
+typedef struct tagTIMESTAMP_STRUCT {
+	SQLSMALLINT year;
+	SQLUSMALLINT month;
+	SQLUSMALLINT day;
+	SQLUSMALLINT hour;
+	SQLUSMALLINT minute;
+	SQLUSMALLINT second;
+	SQLUINTEGER fraction;
+} TIMESTAMP_STRUCT;
+#if (ODBCVER >= 0x0300)
+typedef DATE_STRUCT	SQL_DATE_STRUCT;
+typedef TIME_STRUCT	SQL_TIME_STRUCT;
+typedef TIMESTAMP_STRUCT SQL_TIMESTAMP_STRUCT;
+typedef enum {
+	SQL_IS_YEAR = 1,SQL_IS_MONTH,SQL_IS_DAY,SQL_IS_HOUR,
+	SQL_IS_MINUTE,SQL_IS_SECOND,SQL_IS_YEAR_TO_MONTH,SQL_IS_DAY_TO_HOUR,
+	SQL_IS_DAY_TO_MINUTE,SQL_IS_DAY_TO_SECOND,SQL_IS_HOUR_TO_MINUTE,
+	SQL_IS_HOUR_TO_SECOND,SQL_IS_MINUTE_TO_SECOND
+} SQLINTERVAL;
+typedef struct tagSQL_YEAR_MONTH {
+	SQLUINTEGER year;
+	SQLUINTEGER month;
+} SQL_YEAR_MONTH_STRUCT;
+typedef struct tagSQL_DAY_SECOND {
+	SQLUINTEGER day;
+	SQLUINTEGER	hour;
+	SQLUINTEGER minute;
+	SQLUINTEGER second;
+	SQLUINTEGER fraction;
+} SQL_DAY_SECOND_STRUCT;
+typedef struct tagSQL_INTERVAL_STRUCT {
+	SQLINTERVAL interval_type;
+	SQLSMALLINT interval_sign;
+	union {
+		SQL_YEAR_MONTH_STRUCT year_month;
+		SQL_DAY_SECOND_STRUCT day_second;
+	} intval;
+} SQL_INTERVAL_STRUCT;
+#define SQL_MAX_NUMERIC_LEN 16
+typedef struct tagSQL_NUMERIC_STRUCT {
+	SQLCHAR precision;
+	SQLSCHAR scale;
+	SQLCHAR sign;
+	SQLCHAR val[SQL_MAX_NUMERIC_LEN];
+} SQL_NUMERIC_STRUCT;
+#endif  /* ODBCVER >= 0x0300 */
+#if (ODBCVER >= 0x0350)
+
+#ifdef _GUID_DEFINED
+# warning _GUID_DEFINED is deprecated, use GUID_DEFINED instead
+#endif
+
+#if defined _GUID_DEFINED || defined GUID_DEFINED
+typedef GUID SQLGUID;
+#else
+typedef struct tagSQLGUID{
+    DWORD Data1;
+    WORD Data2;
+    WORD Data3;
+    BYTE Data4[ 8 ];
+} SQLGUID;
+#endif  /* GUID_DEFINED */
+#endif  /* ODBCVER >= 0x0350 */
+#endif     /* RC_INVOKED */
+#ifdef __cplusplus
+}
+#endif
+#endif
diff -Nur tcc-0.9.26.orig/win32/include/sqlucode.h tcc-0.9.26/win32/include/sqlucode.h
--- tcc-0.9.26.orig/win32/include/sqlucode.h	1970-01-01 01:00:00.000000000 +0100
+++ tcc-0.9.26/win32/include/sqlucode.h	2013-11-03 08:29:45.000000000 +0100
@@ -0,0 +1,142 @@
+#ifndef _SQLUCODE_H
+#define _SQLUCODE_H
+#if __GNUC__ >=3
+#pragma GCC system_header
+#endif
+
+#include <sqlext.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+#define SQL_WCHAR (-8)
+#define SQL_WVARCHAR (-9)
+#define SQL_WLONGVARCHAR (-10)
+#define SQL_C_WCHAR SQL_WCHAR
+#define SQL_SQLSTATE_SIZEW	10
+#ifdef UNICODE
+#define SQL_C_TCHAR SQL_C_WCHAR
+#else
+#define SQL_C_TCHAR SQL_C_CHAR
+#endif 
+#ifndef RC_INVOKED
+SQLRETURN SQL_API SQLBrowseConnectA(SQLHDBC,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLSMALLINT*);
+SQLRETURN SQL_API SQLBrowseConnectW(SQLHDBC,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLSMALLINT*);
+SQLRETURN SQL_API SQLColAttributeA(SQLHSTMT,SQLSMALLINT,SQLSMALLINT,SQLPOINTER,SQLSMALLINT,SQLSMALLINT*,SQLPOINTER);	
+SQLRETURN SQL_API SQLColAttributeW(SQLHSTMT,SQLUSMALLINT,SQLUSMALLINT,SQLPOINTER,SQLSMALLINT,SQLSMALLINT*,SQLPOINTER);	
+SQLRETURN SQL_API SQLColAttributesA(SQLHSTMT,SQLUSMALLINT,SQLUSMALLINT,SQLPOINTER,SQLSMALLINT,SQLSMALLINT*,SQLLEN*);
+SQLRETURN SQL_API SQLColAttributesW(SQLHSTMT,SQLUSMALLINT,SQLUSMALLINT,SQLPOINTER,SQLSMALLINT,SQLSMALLINT*,SQLLEN*);
+SQLRETURN SQL_API SQLColumnPrivilegesA( SQLHSTMT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT ,SQLCHAR*,SQLSMALLINT );
+SQLRETURN SQL_API SQLColumnPrivilegesW( SQLHSTMT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT );
+SQLRETURN SQL_API SQLColumnsA(SQLHSTMT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT ,SQLCHAR*,SQLSMALLINT );
+SQLRETURN SQL_API SQLColumnsW(SQLHSTMT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT ,SQLWCHAR*,SQLSMALLINT );
+SQLRETURN SQL_API SQLConnectA(SQLHDBC,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT);
+SQLRETURN SQL_API SQLConnectW(SQLHDBC,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT);
+SQLRETURN SQL_API SQLDataSourcesA(SQLHENV,SQLUSMALLINT,SQLCHAR*,SQLSMALLINT,SQLSMALLINT*,SQLCHAR*,SQLSMALLINT,SQLSMALLINT*);
+SQLRETURN SQL_API SQLDataSourcesW(SQLHENV,SQLUSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLSMALLINT*,SQLWCHAR*,SQLSMALLINT,SQLSMALLINT*);
+SQLRETURN SQL_API SQLDescribeColA(SQLHSTMT,SQLUSMALLINT,SQLCHAR*,SQLSMALLINT,SQLSMALLINT*,SQLSMALLINT*,SQLULEN*,SQLSMALLINT*,SQLSMALLINT*);
+SQLRETURN SQL_API SQLDescribeColW(SQLHSTMT,SQLUSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLSMALLINT*,SQLSMALLINT*,SQLULEN*,SQLSMALLINT*,SQLSMALLINT*);
+SQLRETURN SQL_API SQLDriverConnectA(SQLHDBC,SQLHWND,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLSMALLINT*,SQLUSMALLINT);
+SQLRETURN SQL_API SQLDriverConnectW(SQLHDBC,SQLHWND,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLSMALLINT*,SQLUSMALLINT);
+SQLRETURN SQL_API SQLDriversA(SQLHENV,SQLUSMALLINT,SQLCHAR*,SQLSMALLINT,SQLSMALLINT*,SQLCHAR*,SQLSMALLINT,SQLSMALLINT*);
+SQLRETURN SQL_API SQLDriversW(SQLHENV,SQLUSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLSMALLINT*,SQLWCHAR*,SQLSMALLINT,SQLSMALLINT*);
+SQLRETURN SQL_API SQLErrorA(SQLHENV,SQLHDBC,SQLHSTMT,SQLCHAR*,SQLINTEGER*,SQLCHAR*,SQLSMALLINT,SQLSMALLINT*);
+SQLRETURN SQL_API SQLErrorW(SQLHENV,SQLHDBC,SQLHSTMT,SQLWCHAR*,SQLINTEGER*,SQLWCHAR*,SQLSMALLINT,SQLSMALLINT*);
+SQLRETURN SQL_API SQLExecDirectA(SQLHSTMT,SQLCHAR*,SQLINTEGER);
+SQLRETURN SQL_API SQLExecDirectW(SQLHSTMT,SQLWCHAR*,SQLINTEGER);
+SQLRETURN SQL_API SQLForeignKeysA(SQLHSTMT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT);
+SQLRETURN SQL_API SQLForeignKeysW(SQLHSTMT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT);
+SQLRETURN SQL_API SQLGetConnectAttrA(SQLHDBC,SQLINTEGER,SQLPOINTER,SQLINTEGER,SQLINTEGER*);
+SQLRETURN SQL_API SQLGetConnectAttrW(SQLHDBC,SQLINTEGER,SQLPOINTER,SQLINTEGER,SQLINTEGER*);
+SQLRETURN SQL_API SQLGetConnectOptionA(SQLHDBC,SQLUSMALLINT,SQLPOINTER);
+SQLRETURN SQL_API SQLGetConnectOptionW(SQLHDBC,SQLUSMALLINT,SQLPOINTER);
+SQLRETURN SQL_API SQLGetCursorNameA(SQLHSTMT,SQLCHAR*,SQLSMALLINT,SQLSMALLINT*);
+SQLRETURN SQL_API SQLGetCursorNameW(SQLHSTMT,SQLWCHAR*,SQLSMALLINT,SQLSMALLINT*);
+SQLRETURN SQL_API SQLGetInfoA(SQLHDBC,SQLUSMALLINT,SQLPOINTER,SQLSMALLINT,SQLSMALLINT*);
+SQLRETURN SQL_API SQLGetInfoW(SQLHDBC,SQLUSMALLINT,SQLPOINTER,SQLSMALLINT,SQLSMALLINT*);
+SQLRETURN SQL_API SQLGetTypeInfoA(SQLHSTMT,SQLSMALLINT);
+SQLRETURN SQL_API SQLGetTypeInfoW(SQLHSTMT,SQLSMALLINT);
+SQLRETURN SQL_API SQLNativeSqlA(SQLHDBC,SQLCHAR*,SQLINTEGER,SQLCHAR*,SQLINTEGER,SQLINTEGER*);
+SQLRETURN SQL_API SQLNativeSqlW(SQLHDBC,SQLWCHAR*,SQLINTEGER,SQLWCHAR*,SQLINTEGER,SQLINTEGER*);
+SQLRETURN SQL_API SQLPrepareA(SQLHSTMT,SQLCHAR*,SQLINTEGER);
+SQLRETURN SQL_API SQLPrepareW(SQLHSTMT,SQLWCHAR*,SQLINTEGER);
+SQLRETURN SQL_API SQLPrimaryKeysA(SQLHSTMT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT );
+SQLRETURN SQL_API SQLPrimaryKeysW(SQLHSTMT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT);
+SQLRETURN SQL_API SQLProcedureColumnsA(SQLHSTMT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT);
+SQLRETURN SQL_API SQLProcedureColumnsW(SQLHSTMT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT);
+SQLRETURN SQL_API SQLProceduresA(SQLHSTMT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT);
+SQLRETURN SQL_API SQLProceduresW(SQLHSTMT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT);
+SQLRETURN SQL_API SQLSetConnectAttrA(SQLHDBC,SQLINTEGER,SQLPOINTER,SQLINTEGER);
+SQLRETURN SQL_API SQLSetConnectAttrW(SQLHDBC,SQLINTEGER,SQLPOINTER,SQLINTEGER);
+SQLRETURN SQL_API SQLSetConnectOptionA(SQLHDBC,SQLUSMALLINT,SQLULEN);
+SQLRETURN SQL_API SQLSetConnectOptionW(SQLHDBC,SQLUSMALLINT,SQLULEN);
+SQLRETURN SQL_API SQLSetCursorNameA(SQLHSTMT,SQLCHAR*,SQLSMALLINT);
+SQLRETURN SQL_API SQLSetCursorNameW(SQLHSTMT,SQLWCHAR*,SQLSMALLINT);
+SQLRETURN SQL_API SQLSpecialColumnsA(SQLHSTMT,SQLUSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT ,SQLUSMALLINT,SQLUSMALLINT);
+SQLRETURN SQL_API SQLSpecialColumnsW(SQLHSTMT,SQLUSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT ,SQLUSMALLINT,SQLUSMALLINT);
+SQLRETURN SQL_API SQLStatisticsA(SQLHSTMT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT ,SQLUSMALLINT,SQLUSMALLINT);
+SQLRETURN SQL_API SQLStatisticsW(SQLHSTMT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT ,SQLUSMALLINT,SQLUSMALLINT);
+SQLRETURN SQL_API SQLTablePrivilegesA(SQLHSTMT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT);
+SQLRETURN SQL_API SQLTablePrivilegesW(SQLHSTMT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT );
+SQLRETURN SQL_API SQLTablesA(SQLHSTMT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT);
+SQLRETURN SQL_API SQLTablesW(SQLHSTMT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT);
+#if (ODBCVER >= 0x0300)
+SQLRETURN SQL_API SQLGetDescFieldA(SQLHDESC,SQLSMALLINT,SQLSMALLINT,SQLPOINTER,SQLINTEGER,SQLINTEGER*);
+SQLRETURN SQL_API SQLGetDescFieldW(SQLHDESC,SQLSMALLINT,SQLSMALLINT,SQLPOINTER,SQLINTEGER,SQLINTEGER*);
+SQLRETURN SQL_API SQLSetDescFieldA(SQLHDESC,SQLSMALLINT,SQLSMALLINT,SQLPOINTER,SQLINTEGER);
+SQLRETURN SQL_API SQLSetDescFieldW(SQLHDESC,SQLSMALLINT,SQLSMALLINT,SQLPOINTER,SQLINTEGER);
+SQLRETURN SQL_API SQLGetDescRecA(SQLHDESC,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLSMALLINT*,SQLSMALLINT*,SQLSMALLINT*,SQLLEN*,SQLSMALLINT*,SQLSMALLINT*,SQLSMALLINT*);
+SQLRETURN SQL_API SQLGetDescRecW(SQLHDESC,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLSMALLINT*,SQLSMALLINT*,SQLSMALLINT*,SQLLEN*,SQLSMALLINT*,SQLSMALLINT*,SQLSMALLINT*);
+SQLRETURN SQL_API SQLGetDiagFieldA(SQLSMALLINT,SQLHANDLE,SQLSMALLINT,SQLSMALLINT,SQLPOINTER,SQLSMALLINT,SQLSMALLINT*);
+SQLRETURN SQL_API SQLGetDiagFieldW(SQLSMALLINT,SQLHANDLE,SQLSMALLINT,SQLSMALLINT,SQLPOINTER,SQLSMALLINT,SQLSMALLINT*);
+SQLRETURN SQL_API SQLGetDiagRecA(SQLSMALLINT,SQLHANDLE,SQLSMALLINT,SQLCHAR*,SQLINTEGER*,SQLCHAR*,SQLSMALLINT,SQLSMALLINT*);
+SQLRETURN SQL_API SQLGetDiagRecW(SQLSMALLINT,SQLHANDLE,SQLSMALLINT,SQLWCHAR*,SQLINTEGER*,SQLWCHAR*,SQLSMALLINT,SQLSMALLINT*);
+SQLRETURN SQL_API SQLGetStmtAttrA(SQLHSTMT,SQLINTEGER,SQLPOINTER,SQLINTEGER,SQLINTEGER*);
+SQLRETURN SQL_API SQLGetStmtAttrW(SQLHSTMT,SQLINTEGER,SQLPOINTER,SQLINTEGER,SQLINTEGER*);
+SQLRETURN SQL_API SQLSetStmtAttrA(SQLHSTMT,SQLINTEGER,SQLPOINTER,SQLINTEGER);
+SQLRETURN SQL_API SQLSetStmtAttrW(SQLHSTMT,SQLINTEGER,SQLPOINTER,SQLINTEGER);
+#endif /* (ODBCVER >= 0x0300) */
+
+#if defined (UNICODE) && !defined (SQL_NOUNICODEMAP) 
+#define SQLBrowseConnect SQLBrowseConnectW
+#define SQLColAttribute SQLColAttributeW
+#define SQLColAttributes SQLColAttributesW
+#define SQLColumnPrivileges SQLColumnPrivilegesW
+#define SQLColumns SQLColumnsW
+#define SQLConnect SQLConnectW
+#define SQLDataSources SQLDataSourcesW
+#define SQLDescribeCol SQLDescribeColW
+#define SQLDriverConnect SQLDriverConnectW
+#define SQLDrivers SQLDriversW
+#define SQLError SQLErrorW
+#define SQLExecDirect SQLExecDirectW
+#define SQLForeignKeys SQLForeignKeysW
+#define SQLGetConnectAttr SQLGetConnectAttrW
+#define SQLGetConnectOption SQLGetConnectOptionW
+#define SQLGetCursorName SQLGetCursorNameW
+#define SQLGetDescField SQLGetDescFieldW
+#define SQLGetDescRec SQLGetDescRecW
+#define SQLGetDiagField SQLGetDiagFieldW
+#define SQLGetDiagRec SQLGetDiagRecW
+#define SQLGetInfo SQLGetInfoW
+#define SQLGetStmtAttr SQLGetStmtAttrW
+#define SQLGetTypeInfo SQLGetTypeInfoW
+#define SQLNativeSql SQLNativeSqlW
+#define SQLPrepare SQLPrepareW
+#define SQLPrimaryKeys SQLPrimaryKeysW
+#define SQLProcedureColumns SQLProcedureColumnsW
+#define SQLProcedures SQLProceduresW
+#define SQLSetConnectAttr SQLSetConnectAttrW
+#define SQLSetConnectOption SQLSetConnectOptionW
+#define SQLSetCursorName SQLSetCursorNameW
+#define SQLSetDescField SQLSetDescFieldW
+#define SQLSetStmtAttr SQLSetStmtAttrW
+#define SQLSpecialColumns SQLSpecialColumnsW
+#define SQLStatistics SQLStatisticsW
+#define SQLTablePrivileges SQLTablePrivilegesW
+#define SQLTables SQLTablesW
+#endif /* UNICODE && ! SQL_NOUNICODEMAP */
+#endif /* RC_INVOKED */
+#ifdef __cplusplus
+}
+#endif  /* __cplusplus*/
+#endif  /* ndef _SQLUCODE_H */
diff -Nur tcc-0.9.26.orig/win32/include/winapi/mswsock.h tcc-0.9.26/win32/include/winapi/mswsock.h
--- tcc-0.9.26.orig/win32/include/winapi/mswsock.h	1970-01-01 01:00:00.000000000 +0100
+++ tcc-0.9.26/win32/include/winapi/mswsock.h	2013-11-03 08:29:45.000000000 +0100
@@ -0,0 +1,113 @@
+/*
+ * mswsock.h
+ * MS-specific extensions to Windows Sockets, exported from mswsock.dll.
+ * These functions are N/A on Windows9x.
+ *
+ * This file is part of a free library for the Win32 API.
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ */
+         
+#ifndef _MSWSOCK_H
+#define _MSWSOCK_H
+#if __GNUC__ >=3
+#pragma GCC system_header
+#endif
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define SO_CONNDATA	0x7000
+#define SO_CONNOPT	0x7001
+#define SO_DISCDATA	0x7002
+#define SO_DISCOPT	0x7003
+#define SO_CONNDATALEN	0x7004
+#define SO_CONNOPTLEN	0x7005
+#define SO_DISCDATALEN	0x7006
+#define SO_DISCOPTLEN	0x7007
+#define SO_OPENTYPE	0x7008
+#define SO_SYNCHRONOUS_ALERT	0x10
+#define SO_SYNCHRONOUS_NONALERT	0x20
+#define SO_MAXDG	0x7009
+#define SO_MAXPATHDG	0x700A
+#define SO_UPDATE_ACCEPT_CONTEXT	0x700B
+#define SO_CONNECT_TIME	0x700C
+#define TCP_BSDURGENT	0x7000
+
+#define TF_DISCONNECT   1
+#define TF_REUSE_SOCKET 2
+#define TF_WRITE_BEHIND 4
+#define TF_USE_DEFAULT_WORKER   0
+#define TF_USE_SYSTEM_THREAD    16
+#define TF_USE_KERNEL_APC   32
+
+typedef struct _TRANSMIT_FILE_BUFFERS {
+	PVOID Head;
+	DWORD HeadLength;
+	PVOID Tail;
+	DWORD TailLength;
+} TRANSMIT_FILE_BUFFERS, *PTRANSMIT_FILE_BUFFERS, *LPTRANSMIT_FILE_BUFFERS;
+
+int PASCAL WSARecvEx(SOCKET,char*,int,int*);
+BOOL PASCAL TransmitFile(SOCKET,HANDLE,DWORD,DWORD,LPOVERLAPPED,LPTRANSMIT_FILE_BUFFERS,DWORD);
+BOOL PASCAL AcceptEx(SOCKET,SOCKET,PVOID,DWORD,DWORD,DWORD,LPDWORD,LPOVERLAPPED);
+VOID PASCAL GetAcceptExSockaddrs(PVOID,DWORD,DWORD,DWORD,struct sockaddr**, LPINT, struct sockaddr**, LPINT);
+
+#ifdef _WINSOCK2_H /* These require the winsock2 interface.  */
+
+#define TP_ELEMENT_FILE		1
+#define TP_ELEMENT_MEMORY	2
+#define TP_ELEMENT_EOP		4
+
+typedef struct _TRANSMIT_PACKETS_ELEMENT { 
+	ULONG dwElFlags;
+	ULONG cLength;
+	_ANONYMOUS_UNION
+	union {
+		struct {
+			LARGE_INTEGER	nFileOffset;
+			HANDLE		hFile;
+		};
+		PVOID	pBuffer;
+	};
+} TRANSMIT_PACKETS_ELEMENT; 
+
+typedef struct _WSAMSG {
+	LPSOCKADDR	name;
+	INT		namelen;
+	LPWSABUF	lpBuffers;
+	DWORD		dwBufferCount;
+	WSABUF		Control;
+	DWORD		dwFlags;
+} WSAMSG, *PWSAMSG, *LPWSAMSG;
+
+
+/* According to MSDN docs, the WSAMSG.Control buffer starts with a
+   cmsghdr header of the following form.  See also RFC 2292. */
+
+typedef struct wsacmsghdr {
+	UINT	cmsg_len;
+	INT	cmsg_level;
+ 	INT	cmsg_type;
+	/* followed by UCHAR cmsg_data[]; */
+} WSACMSGHDR;
+
+/* TODO: Standard Posix.1g macros as per RFC 2292, with WSA_uglification. */
+#if 0
+#define WSA_CMSG_FIRSTHDR(mhdr)
+#define WSA_CMSG_NXTHDR(mhdr, cmsg)
+#define WSA_CMSG_SPACE(length)
+#define WSA_CMSG_LEN(length)
+#endif
+
+BOOL PASCAL DisconnectEx(SOCKET,LPOVERLAPPED,DWORD,DWORD);
+int PASCAL WSARecvMsg(SOCKET,LPWSAMSG,LPDWORD,LPWSAOVERLAPPED,LPWSAOVERLAPPED_COMPLETION_ROUTINE);
+
+#endif /* _WINSOCK2_H */
+
+#ifdef __cplusplus
+}
+#endif
+#endif  /*  _MSWSOCK_H */
+
diff -Nur tcc-0.9.26.orig/win32/include/winapi/winsock.h tcc-0.9.26/win32/include/winapi/winsock.h
--- tcc-0.9.26.orig/win32/include/winapi/winsock.h	1970-01-01 01:00:00.000000000 +0100
+++ tcc-0.9.26/win32/include/winapi/winsock.h	2013-11-03 08:29:45.000000000 +0100
@@ -0,0 +1,535 @@
+/*
+
+  Definitions for winsock 1.1
+  
+  Portions Copyright (c) 1980, 1983, 1988, 1993
+  The Regents of the University of California.  All rights reserved.
+
+  Portions Copyright (c) 1993 by Digital Equipment Corporation.
+ */
+
+#ifndef _WINSOCK_H
+#define _WINSOCK_H
+#if __GNUC__ >=3
+#pragma GCC system_header
+#endif
+
+#define _GNU_H_WINDOWS32_SOCKETS
+#include <windows.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if !defined ( _BSDTYPES_DEFINED )
+/* also defined in gmon.h and in cygwin's sys/types */
+typedef unsigned char	u_char;
+typedef unsigned short	u_short;
+typedef unsigned int	u_int;
+typedef unsigned long	u_long;
+#define _BSDTYPES_DEFINED
+#endif /* !defined  _BSDTYPES_DEFINED */
+typedef u_int	SOCKET;
+#ifndef FD_SETSIZE
+#define FD_SETSIZE	64
+#endif
+
+/* shutdown() how types */
+#define SD_RECEIVE      0x00
+#define SD_SEND         0x01
+#define SD_BOTH         0x02
+
+#ifndef _SYS_TYPES_FD_SET
+/* fd_set may have be defined by the newlib <sys/types.h>
+ * if  __USE_W32_SOCKETS not defined.
+ */
+#ifdef fd_set
+#undef fd_set
+#endif
+typedef struct fd_set {
+	u_int   fd_count;
+	SOCKET  fd_array[FD_SETSIZE];
+} fd_set;
+int PASCAL __WSAFDIsSet(SOCKET,fd_set*);
+#ifndef FD_CLR
+#define FD_CLR(fd,set) do { u_int __i;\
+for (__i = 0; __i < ((fd_set *)(set))->fd_count ; __i++) {\
+	if (((fd_set *)(set))->fd_array[__i] == (fd)) {\
+	while (__i < ((fd_set *)(set))->fd_count-1) {\
+		((fd_set*)(set))->fd_array[__i] = ((fd_set*)(set))->fd_array[__i+1];\
+		__i++;\
+	}\
+	((fd_set*)(set))->fd_count--;\
+	break;\
+	}\
+}\
+} while (0)
+#endif
+#ifndef FD_SET
+#define FD_SET(fd, set) do { \
+    if (((fd_set *)(set))->fd_count < FD_SETSIZE) \
+	((fd_set *)(set))->fd_array[((fd_set *)(set))->fd_count++]=(fd);\
+}while (0)
+#endif
+#ifndef FD_ZERO
+#define FD_ZERO(set) (((fd_set *)(set))->fd_count=0)
+#endif
+#ifndef FD_ISSET
+#define FD_ISSET(fd, set) __WSAFDIsSet((SOCKET)(fd), (fd_set *)(set))
+#endif
+#elif !defined(USE_SYS_TYPES_FD_SET)
+#warning "fd_set and associated macros have been defined in sys/types.  \
+    This can cause runtime problems with W32 sockets" 
+#endif /* ndef _SYS_TYPES_FD_SET */
+
+#if !(defined (__INSIDE_CYGWIN__) || defined (__INSIDE_MSYS__))
+#ifndef _TIMEVAL_DEFINED /* also in sys/time.h */
+#define _TIMEVAL_DEFINED
+struct timeval {
+	long    tv_sec;
+	long    tv_usec;
+};
+#define timerisset(tvp)	 ((tvp)->tv_sec || (tvp)->tv_usec)
+#define timercmp(tvp, uvp, cmp) \
+	(((tvp)->tv_sec != (uvp)->tv_sec) ? \
+	((tvp)->tv_sec cmp (uvp)->tv_sec) : \
+	((tvp)->tv_usec cmp (uvp)->tv_usec))
+#define timerclear(tvp)	 (tvp)->tv_sec = (tvp)->tv_usec = 0
+#endif /* _TIMEVAL_DEFINED */
+struct  hostent {
+	char	*h_name;
+	char	**h_aliases;
+	short	h_addrtype;
+	short	h_length;
+	char	**h_addr_list;
+#define h_addr h_addr_list[0]
+};
+struct linger {
+	u_short l_onoff;
+	u_short l_linger;
+};
+#endif /* ! (__INSIDE_CYGWIN__ || __INSIDE_MSYS__) */
+#define IOCPARM_MASK	0x7f
+#define IOC_VOID	0x20000000
+#define IOC_OUT	0x40000000
+#define IOC_IN	0x80000000
+#define IOC_INOUT	(IOC_IN|IOC_OUT)
+
+#if !(defined (__INSIDE_CYGWIN__) || defined (__INSIDE_MSYS__))
+#define _IO(x,y)	(IOC_VOID|((x)<<8)|(y))
+#define _IOR(x,y,t)	(IOC_OUT|(((long)sizeof(t)&IOCPARM_MASK)<<16)|((x)<<8)|(y))
+#define _IOW(x,y,t)	(IOC_IN|(((long)sizeof(t)&IOCPARM_MASK)<<16)|((x)<<8)|(y))
+#define FIONBIO	_IOW('f', 126, u_long)
+#endif /* ! (__INSIDE_CYGWIN__ || __INSIDE_MSYS__) */
+
+#define FIONREAD	_IOR('f', 127, u_long)
+#define FIOASYNC	_IOW('f', 125, u_long)
+#define SIOCSHIWAT	_IOW('s',  0, u_long)
+#define SIOCGHIWAT	_IOR('s',  1, u_long)
+#define SIOCSLOWAT	_IOW('s',  2, u_long)
+#define SIOCGLOWAT	_IOR('s',  3, u_long)
+#define SIOCATMARK	_IOR('s',  7, u_long)
+
+#if !(defined (__INSIDE_CYGWIN__) || defined (__INSIDE_MSYS__))
+struct netent {
+	char	* n_name;
+	char	**n_aliases;
+	short	n_addrtype;
+	u_long n_net;
+};
+struct  servent {
+	char	*s_name;
+	char	**s_aliases;
+	short	s_port;
+	char	*s_proto;
+};
+struct  protoent {
+	char	*p_name;
+	char	**p_aliases;
+	short	p_proto;
+};
+#endif /* ! (__INSIDE_CYGWIN__ || __INSIDE_MSYS__) */
+
+#define IPPROTO_IP	0
+#define IPPROTO_ICMP	1
+#define IPPROTO_IGMP 2
+#define IPPROTO_GGP 3
+#define IPPROTO_TCP	6
+#define IPPROTO_PUP	12
+#define IPPROTO_UDP	17
+#define IPPROTO_IDP	22
+#define IPPROTO_ND	77
+#define IPPROTO_RAW	255
+#define IPPROTO_MAX	256
+#define IPPORT_ECHO	7
+#define IPPORT_DISCARD	9
+#define IPPORT_SYSTAT	11
+#define IPPORT_DAYTIME  13
+#define IPPORT_NETSTAT  15
+#define IPPORT_FTP      21
+#define IPPORT_TELNET   23
+#define IPPORT_SMTP     25
+#define IPPORT_TIMESERVER 37
+#define IPPORT_NAMESERVER 42
+#define IPPORT_WHOIS	43
+#define IPPORT_MTP	57
+#define IPPORT_TFTP	69
+#define IPPORT_RJE	77
+#define IPPORT_FINGER	79
+#define IPPORT_TTYLINK	87
+#define IPPORT_SUPDUP	95
+#define IPPORT_EXECSERVER	512
+#define IPPORT_LOGINSERVER	513
+#define IPPORT_CMDSERVER	514
+#define IPPORT_EFSSERVER	520
+#define IPPORT_BIFFUDP	512
+#define IPPORT_WHOSERVER	513
+#define IPPORT_ROUTESERVER	520
+#define IPPORT_RESERVED	1024
+#define IMPLINK_IP	155
+#define IMPLINK_LOWEXPER	156
+#define IMPLINK_HIGHEXPER       158
+struct in_addr {
+	union {
+		struct { u_char s_b1,s_b2,s_b3,s_b4; } S_un_b;
+		struct { u_short s_w1,s_w2; } S_un_w;
+		u_long S_addr;
+	} S_un;
+#define s_addr  S_un.S_addr
+#define s_host  S_un.S_un_b.s_b2
+#define s_net   S_un.S_un_b.s_b1
+#define s_imp   S_un.S_un_w.s_w2
+#define s_impno S_un.S_un_b.s_b4
+#define s_lh    S_un.S_un_b.s_b3
+};
+#define IN_CLASSA(i)	(((long)(i)&0x80000000) == 0)
+#define IN_CLASSA_NET	0xff000000
+#define IN_CLASSA_NSHIFT	24
+#define IN_CLASSA_HOST	0x00ffffff
+#define IN_CLASSA_MAX	128
+#define IN_CLASSB(i)	(((long)(i)&0xc0000000)==0x80000000)
+#define IN_CLASSB_NET	   0xffff0000
+#define IN_CLASSB_NSHIFT	16
+#define IN_CLASSB_HOST	  0x0000ffff
+#define IN_CLASSB_MAX	   65536
+#define IN_CLASSC(i)	(((long)(i)&0xe0000000)==0xc0000000)
+#define IN_CLASSC_NET	   0xffffff00
+#define IN_CLASSC_NSHIFT	8
+#define IN_CLASSC_HOST	  0xff
+#define INADDR_ANY	      (u_long)0
+#define INADDR_LOOPBACK	 0x7f000001
+#define INADDR_BROADCAST	(u_long)0xffffffff
+#define INADDR_NONE	0xffffffff
+struct sockaddr_in {
+	short	sin_family;
+	u_short	sin_port;
+	struct	in_addr sin_addr;
+	char	sin_zero[8];
+};
+#define WSADESCRIPTION_LEN	256
+#define WSASYS_STATUS_LEN	128
+typedef struct WSAData {
+	WORD	wVersion;
+	WORD	wHighVersion;
+	char	szDescription[WSADESCRIPTION_LEN+1];
+	char	szSystemStatus[WSASYS_STATUS_LEN+1];
+	unsigned short	iMaxSockets;
+	unsigned short	iMaxUdpDg;
+	char * 	lpVendorInfo;
+} WSADATA;
+typedef WSADATA *LPWSADATA;
+
+#if !(defined (__INSIDE_CYGWIN__) || defined (__INSIDE_MSYS__))
+#define IP_OPTIONS	1
+#define SO_DEBUG	1
+#define SO_ACCEPTCONN	2
+#define SO_REUSEADDR	4
+#define SO_KEEPALIVE	8
+#define SO_DONTROUTE	16
+#define SO_BROADCAST	32
+#define SO_USELOOPBACK	64
+#define SO_LINGER	128
+#define SO_OOBINLINE	256
+#define SO_DONTLINGER	(u_int)(~SO_LINGER)
+#define SO_SNDBUF	0x1001
+#define SO_RCVBUF	0x1002
+#define SO_SNDLOWAT	0x1003
+#define SO_RCVLOWAT	0x1004
+#define SO_SNDTIMEO	0x1005
+#define SO_RCVTIMEO	0x1006
+#define SO_ERROR	0x1007
+#define SO_TYPE	0x1008
+#endif /* ! (__INSIDE_CYGWIN__ || __INSIDE_MSYS__) */
+/*
+ * Note that the next 5 IP defines are specific to WinSock 1.1 (wsock32.dll).
+ * They will cause errors or unexpected results if used with the
+ * (gs)etsockopts exported from the WinSock 2 lib, ws2_32.dll. Refer ws2tcpip.h.
+ */         
+#define IP_MULTICAST_IF	2
+#define IP_MULTICAST_TTL	3
+#define IP_MULTICAST_LOOP	4
+#define IP_ADD_MEMBERSHIP	5
+#define IP_DROP_MEMBERSHIP  6
+
+#define IP_DEFAULT_MULTICAST_TTL   1
+#define IP_DEFAULT_MULTICAST_LOOP  1
+#define IP_MAX_MEMBERSHIPS	 20
+struct ip_mreq {
+	struct in_addr imr_multiaddr;
+	struct in_addr imr_interface;
+};
+#define INVALID_SOCKET (SOCKET)(~0)
+#define SOCKET_ERROR	(-1)
+#define SOCK_STREAM	1
+#define SOCK_DGRAM	2
+#define SOCK_RAW	3
+#define SOCK_RDM	4
+#define SOCK_SEQPACKET	5
+#define TCP_NODELAY	0x0001
+#define AF_UNSPEC	0
+#define AF_UNIX	1
+#define AF_INET	2
+#define AF_IMPLINK	3
+#define AF_PUP	4
+#define AF_CHAOS	5
+#define AF_IPX	6
+#define AF_NS	6
+#define AF_ISO	7
+#define AF_OSI	AF_ISO
+#define AF_ECMA	8
+#define AF_DATAKIT	9
+#define AF_CCITT	10
+#define AF_SNA	11
+#define AF_DECnet	12
+#define AF_DLI	13
+#define AF_LAT	14
+#define AF_HYLINK	15
+#define AF_APPLETALK	16
+#define AF_NETBIOS	17
+#define AF_VOICEVIEW	18
+#define	AF_FIREFOX	19
+#define	AF_UNKNOWN1	20
+#define	AF_BAN	21
+#define AF_ATM	22
+#define AF_INET6	23
+#if !(defined (__INSIDE_CYGWIN__) || defined (__INSIDE_MSYS__))
+#define AF_MAX	24
+struct sockaddr {
+	u_short sa_family;
+	char	sa_data[14];
+};
+#endif /* ! (__INSIDE_CYGWIN__ || __INSIDE_MSYS__) */
+
+struct sockproto {
+	u_short sp_family;
+	u_short sp_protocol;
+};
+#define PF_UNSPEC	AF_UNSPEC
+#define PF_UNIX	AF_UNIX
+#define PF_INET	AF_INET
+#define PF_IMPLINK	AF_IMPLINK
+#define PF_PUP	AF_PUP
+#define PF_CHAOS	AF_CHAOS
+#define PF_NS	AF_NS
+#define PF_IPX	AF_IPX
+#define PF_ISO	AF_ISO
+#define PF_OSI	AF_OSI
+#define PF_ECMA	AF_ECMA
+#define PF_DATAKIT	AF_DATAKIT
+#define PF_CCITT	AF_CCITT
+#define PF_SNA	AF_SNA
+#define PF_DECnet	AF_DECnet
+#define PF_DLI	AF_DLI
+#define PF_LAT	AF_LAT
+#define PF_HYLINK	AF_HYLINK
+#define PF_APPLETALK	AF_APPLETALK
+#define PF_VOICEVIEW	AF_VOICEVIEW
+#define PF_FIREFOX	AF_FIREFOX
+#define PF_UNKNOWN1	AF_UNKNOWN1
+#define PF_BAN	AF_BAN
+#define PF_ATM	AF_ATM
+#define PF_INET6	AF_INET6
+#define PF_MAX	AF_MAX
+#define SOL_SOCKET	0xffff
+#define SOMAXCONN	5
+#if !(defined (__INSIDE_CYGWIN__) || defined (__INSIDE_MSYS__))
+#define MSG_OOB	1
+#define MSG_PEEK	2
+#define MSG_DONTROUTE	4
+#endif  /* ! (__INSIDE_CYGWIN__ || __INSIDE_MSYS__) */
+#define MSG_MAXIOVLEN	16
+#define MSG_PARTIAL	0x8000
+#define MAXGETHOSTSTRUCT	1024
+#define FD_READ	1
+#define FD_WRITE	2
+#define FD_OOB	4
+#define FD_ACCEPT	8
+#define FD_CONNECT	16
+#define FD_CLOSE	32
+#ifndef WSABASEERR
+#define WSABASEERR	10000
+#define WSAEINTR	(WSABASEERR+4)
+#define WSAEBADF	(WSABASEERR+9)
+#define WSAEACCES	(WSABASEERR+13)
+#define WSAEFAULT	(WSABASEERR+14)
+#define WSAEINVAL	(WSABASEERR+22)
+#define WSAEMFILE	(WSABASEERR+24)
+#define WSAEWOULDBLOCK	(WSABASEERR+35)
+#define WSAEINPROGRESS	(WSABASEERR+36)
+#define WSAEALREADY	(WSABASEERR+37)
+#define WSAENOTSOCK	(WSABASEERR+38)
+#define WSAEDESTADDRREQ	(WSABASEERR+39)
+#define WSAEMSGSIZE	(WSABASEERR+40)
+#define WSAEPROTOTYPE	(WSABASEERR+41)
+#define WSAENOPROTOOPT	(WSABASEERR+42)
+#define WSAEPROTONOSUPPORT	(WSABASEERR+43)
+#define WSAESOCKTNOSUPPORT	(WSABASEERR+44)
+#define WSAEOPNOTSUPP	(WSABASEERR+45)
+#define WSAEPFNOSUPPORT	(WSABASEERR+46)
+#define WSAEAFNOSUPPORT	(WSABASEERR+47)
+#define WSAEADDRINUSE	(WSABASEERR+48)
+#define WSAEADDRNOTAVAIL	(WSABASEERR+49)
+#define WSAENETDOWN	(WSABASEERR+50)
+#define WSAENETUNREACH	(WSABASEERR+51)
+#define WSAENETRESET	(WSABASEERR+52)
+#define WSAECONNABORTED	(WSABASEERR+53)
+#define WSAECONNRESET	(WSABASEERR+54)
+#define WSAENOBUFS	(WSABASEERR+55)
+#define WSAEISCONN	(WSABASEERR+56)
+#define WSAENOTCONN	(WSABASEERR+57)
+#define WSAESHUTDOWN	(WSABASEERR+58)
+#define WSAETOOMANYREFS	(WSABASEERR+59)
+#define WSAETIMEDOUT	(WSABASEERR+60)
+#define WSAECONNREFUSED	(WSABASEERR+61)
+#define WSAELOOP	(WSABASEERR+62)
+#define WSAENAMETOOLONG	(WSABASEERR+63)
+#define WSAEHOSTDOWN	(WSABASEERR+64)
+#define WSAEHOSTUNREACH	(WSABASEERR+65)
+#define WSAENOTEMPTY	(WSABASEERR+66)
+#define WSAEPROCLIM	(WSABASEERR+67)
+#define WSAEUSERS	(WSABASEERR+68)
+#define WSAEDQUOT	(WSABASEERR+69)
+#define WSAESTALE	(WSABASEERR+70)
+#define WSAEREMOTE	(WSABASEERR+71)
+#define WSAEDISCON	(WSABASEERR+101)
+#define WSASYSNOTREADY	(WSABASEERR+91)
+#define WSAVERNOTSUPPORTED	(WSABASEERR+92)
+#define WSANOTINITIALISED	(WSABASEERR+93)
+#define WSAHOST_NOT_FOUND	(WSABASEERR+1001)
+#define WSATRY_AGAIN	(WSABASEERR+1002)
+#define WSANO_RECOVERY	(WSABASEERR+1003)
+#define WSANO_DATA	(WSABASEERR+1004)
+#endif /* !WSABASEERR */
+
+#define WSANO_ADDRESS	WSANO_DATA
+#if !(defined (__INSIDE_CYGWIN__) || defined (__INSIDE_MSYS__))
+#define h_errno WSAGetLastError()
+#define HOST_NOT_FOUND	WSAHOST_NOT_FOUND
+#define TRY_AGAIN	WSATRY_AGAIN
+#define NO_RECOVERY	WSANO_RECOVERY
+#define NO_DATA	WSANO_DATA
+#define NO_ADDRESS	WSANO_ADDRESS
+#endif /* ! (__INSIDE_CYGWIN__ || __INSIDE_MSYS__) */
+SOCKET PASCAL accept(SOCKET,struct sockaddr*,int*);
+int PASCAL bind(SOCKET,const struct sockaddr*,int);
+int PASCAL closesocket(SOCKET);
+int PASCAL connect(SOCKET,const struct sockaddr*,int);
+int PASCAL ioctlsocket(SOCKET,long,u_long *);
+int PASCAL getpeername(SOCKET,struct sockaddr*,int*);
+int PASCAL getsockname(SOCKET,struct sockaddr*,int*);
+int PASCAL getsockopt(SOCKET,int,int,char*,int*);
+unsigned long PASCAL inet_addr(const char*);
+DECLARE_STDCALL_P(char *) inet_ntoa(struct in_addr);
+int PASCAL listen(SOCKET,int);
+int PASCAL recv(SOCKET,char*,int,int);
+int PASCAL recvfrom(SOCKET,char*,int,int,struct sockaddr*,int*);
+int PASCAL send(SOCKET,const char*,int,int);
+int PASCAL sendto(SOCKET,const char*,int,int,const struct sockaddr*,int);
+int PASCAL setsockopt(SOCKET,int,int,const char*,int);
+int PASCAL shutdown(SOCKET,int);
+SOCKET PASCAL socket(int,int,int);
+DECLARE_STDCALL_P(struct hostent *) gethostbyaddr(const char*,int,int);
+DECLARE_STDCALL_P(struct hostent *) gethostbyname(const char*);
+DECLARE_STDCALL_P(struct servent *) getservbyport(int,const char*);
+DECLARE_STDCALL_P(struct servent *) getservbyname(const char*,const char*);
+DECLARE_STDCALL_P(struct protoent *) getprotobynumber(int);
+DECLARE_STDCALL_P(struct protoent *) getprotobyname(const char*);
+int PASCAL WSAStartup(WORD,LPWSADATA);
+int PASCAL WSACleanup(void);
+void PASCAL WSASetLastError(int);
+int PASCAL WSAGetLastError(void);
+BOOL PASCAL WSAIsBlocking(void);
+int PASCAL WSAUnhookBlockingHook(void);
+FARPROC PASCAL WSASetBlockingHook(FARPROC);
+int PASCAL WSACancelBlockingCall(void);
+HANDLE PASCAL WSAAsyncGetServByName(HWND,u_int,const char*,const char*,char*,int);
+HANDLE PASCAL WSAAsyncGetServByPort(HWND,u_int,int,const char*,char*,int);
+HANDLE PASCAL WSAAsyncGetProtoByName(HWND,u_int,const char*,char*,int);
+HANDLE PASCAL WSAAsyncGetProtoByNumber(HWND,u_int,int,char*,int);
+HANDLE PASCAL WSAAsyncGetHostByName(HWND,u_int,const char*,char*,int);
+HANDLE PASCAL WSAAsyncGetHostByAddr(HWND,u_int,const char*,int,int,char*,int);
+int PASCAL WSACancelAsyncRequest(HANDLE);
+int PASCAL WSAAsyncSelect(SOCKET,HWND,u_int,long);
+#if !(defined (__INSIDE_CYGWIN__) || defined (__INSIDE_MSYS__))
+u_long PASCAL htonl(u_long);
+u_long PASCAL ntohl(u_long);
+u_short PASCAL htons(u_short);
+u_short PASCAL ntohs(u_short);
+int PASCAL select(int nfds,fd_set*,fd_set*,fd_set*,const struct timeval*);
+int PASCAL gethostname(char*,int);
+#endif /* ! (__INSIDE_CYGWIN__ || __INSIDE_MSYS__) */
+
+#define WSAMAKEASYNCREPLY(b,e)	MAKELONG(b,e)
+#define WSAMAKESELECTREPLY(e,error)	MAKELONG(e,error)
+#define WSAGETASYNCBUFLEN(l)	LOWORD(l)
+#define WSAGETASYNCERROR(l)	HIWORD(l)
+#define WSAGETSELECTEVENT(l)	LOWORD(l)
+#define WSAGETSELECTERROR(l)	HIWORD(l)
+
+typedef struct sockaddr SOCKADDR;
+typedef struct sockaddr *PSOCKADDR;
+typedef struct sockaddr *LPSOCKADDR;
+typedef struct sockaddr_in SOCKADDR_IN;
+typedef struct sockaddr_in *PSOCKADDR_IN;
+typedef struct sockaddr_in *LPSOCKADDR_IN;
+typedef struct linger LINGER;
+typedef struct linger *PLINGER;
+typedef struct linger *LPLINGER;
+typedef struct in_addr IN_ADDR;
+typedef struct in_addr *PIN_ADDR;
+typedef struct in_addr *LPIN_ADDR;
+typedef struct fd_set FD_SET;
+typedef struct fd_set *PFD_SET;
+typedef struct fd_set *LPFD_SET;
+typedef struct hostent HOSTENT;
+typedef struct hostent *PHOSTENT;
+typedef struct hostent *LPHOSTENT;
+typedef struct servent SERVENT;
+typedef struct servent *PSERVENT;
+typedef struct servent *LPSERVENT;
+typedef struct protoent PROTOENT;
+typedef struct protoent *PPROTOENT;
+typedef struct protoent *LPPROTOENT;
+typedef struct timeval TIMEVAL;
+typedef struct timeval *PTIMEVAL;
+typedef struct timeval *LPTIMEVAL;
+
+#ifdef __cplusplus
+}
+#endif
+/*
+ * Recent MSDN docs indicate that the MS-specific extensions exported from
+ * mswsock.dll (AcceptEx, TransmitFile. WSARecEx and GetAcceptExSockaddrs) are
+ * declared in mswsock.h. These extensions are not supported on W9x or WinCE.
+ * However, code using WinSock 1.1 API may expect the declarations and
+ * associated defines to be in this header. Thus we include mswsock.h here.
+ *
+ * When linking against the WinSock 1.1 lib, wsock32.dll, the mswsock functions
+ * are automatically routed to mswsock.dll (on platforms with support).
+ * The WinSock 2 lib, ws2_32.dll, does not contain any references to
+ * the mswsock extensions. 
+ */
+
+#include <mswsock.h>
+
+#endif
diff -Nur tcc-0.9.26.orig/win32/lib/odbc32.def tcc-0.9.26/win32/lib/odbc32.def
--- tcc-0.9.26.orig/win32/lib/odbc32.def	1970-01-01 01:00:00.000000000 +0100
+++ tcc-0.9.26/win32/lib/odbc32.def	2013-11-03 08:29:45.000000000 +0100
@@ -0,0 +1,118 @@
+LIBRARY odbc32.dll
+
+EXPORTS
+SQLAllocConnect
+SQLAllocEnv
+SQLAllocStmt
+SQLBindCol
+SQLCancel
+SQLColAttributes
+SQLConnect
+SQLDescribeCol
+SQLDisconnect
+SQLError
+SQLExecDirect
+SQLExecute
+SQLFetch
+SQLFreeConnect
+SQLFreeEnv
+SQLFreeStmt
+SQLGetCursorName
+SQLNumResultCols
+SQLPrepare
+SQLRowCount
+SQLSetCursorName
+SQLSetParam
+SQLTransact
+SQLAllocHandle
+SQLBindParam
+SQLCloseCursor
+SQLColAttribute
+SQLCopyDesc
+SQLEndTran
+SQLFetchScroll
+SQLFreeHandle
+SQLGetConnectAttr
+SQLGetDescField
+SQLGetDescRec
+SQLGetDiagField
+SQLGetDiagRec
+SQLGetEnvAttr
+SQLGetStmtAttr
+SQLSetConnectAttr
+SQLColumns
+SQLDriverConnect
+SQLGetConnectOption
+SQLGetData
+SQLGetFunctions
+SQLGetInfo
+SQLGetStmtOption
+SQLGetTypeInfo
+SQLParamData
+SQLPutData
+SQLSetConnectOption
+SQLSetStmtOption
+SQLSpecialColumns
+SQLStatistics
+SQLTables
+SQLBrowseConnect
+SQLColumnPrivileges
+SQLDataSources
+SQLDescribeParam
+SQLExtendedFetch
+SQLForeignKeys
+SQLMoreResults
+SQLNativeSql
+SQLNumParams
+SQLParamOptions
+SQLPrimaryKeys
+SQLProcedureColumns
+SQLProcedures
+SQLSetPos
+SQLSetScrollOptions
+SQLTablePrivileges
+SQLDrivers
+SQLBindParameter
+SQLSetDescField
+SQLSetDescRec
+SQLSetEnvAttr
+SQLSetStmtAttr
+SQLAllocHandleStd
+SQLBulkOperations
+SQLColAttributesW
+SQLConnectW
+SQLDescribeColW
+SQLErrorW
+SQLExecDirectW
+SQLGetCursorNameW
+SQLPrepareW
+SQLSetCursorNameW
+SQLColAttributeW
+SQLGetConnectAttrW
+SQLGetDescFieldW
+SQLGetDescRecW
+SQLGetDiagFieldW
+SQLGetDiagRecW
+SQLGetStmtAttrW
+SQLSetConnectAttrW
+SQLColumnsW
+SQLDriverConnectW
+SQLGetConnectOptionW
+SQLGetInfoW
+SQLGetTypeInfoW
+SQLSetConnectOptionW
+SQLSpecialColumnsW
+SQLStatisticsW
+SQLTablesW
+SQLBrowseConnectW
+SQLColumnPrivilegesW
+SQLDataSourcesW
+SQLForeignKeysW
+SQLNativeSqlW
+SQLPrimaryKeysW
+SQLProcedureColumnsW
+SQLProceduresW
+SQLTablePrivilegesW
+SQLDriversW
+SQLSetDescFieldW
+SQLSetStmtAttrW
diff -Nur tcc-0.9.26.orig/win32/lib/wsock32.def tcc-0.9.26/win32/lib/wsock32.def
--- tcc-0.9.26.orig/win32/lib/wsock32.def	1970-01-01 01:00:00.000000000 +0100
+++ tcc-0.9.26/win32/lib/wsock32.def	2013-11-03 08:29:45.000000000 +0100
@@ -0,0 +1,76 @@
+LIBRARY wsock32.dll
+
+EXPORTS
+AcceptEx
+EnumProtocolsA
+EnumProtocolsW
+GetAcceptExSockaddrs
+GetAddressByNameA
+GetAddressByNameW
+GetNameByTypeA
+GetNameByTypeW
+GetServiceA
+GetServiceW
+GetTypeByNameA
+GetTypeByNameW
+NPLoadNameSpaces
+SetServiceA
+SetServiceW
+TransmitFile
+WSAAsyncGetHostByAddr
+WSAAsyncGetHostByName
+WSAAsyncGetProtoByName
+WSAAsyncGetProtoByNumber
+WSAAsyncGetServByName
+WSAAsyncGetServByPort
+WSAAsyncSelect
+WSACancelAsyncRequest
+WSACancelBlockingCall
+WSACleanup
+WSAGetLastError
+WSAIsBlocking
+WSARecvEx
+WSASetBlockingHook
+WSASetLastError
+WSAStartup
+WSAUnhookBlockingHook
+WSApSetPostRoutine
+__WSAFDIsSet
+accept
+bind
+closesocket
+connect
+dn_expand
+gethostbyaddr
+gethostbyname
+gethostname
+getnetbyname
+getpeername
+getprotobyname
+getprotobynumber
+getservbyname
+getservbyport
+getsockname
+getsockopt
+htonl
+htons
+inet_addr
+inet_network
+inet_ntoa
+ioctlsocket
+listen
+ntohl
+ntohs
+rcmd
+recv
+recvfrom
+rexec
+rresvport
+s_perror
+select
+send
+sendto
+sethostname
+setsockopt
+shutdown
+socket
