forked from softace/sqliteodbc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tcc-0.9.24.patch
3226 lines (3214 loc) · 117 KB
/
tcc-0.9.24.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
diff -Nur tcc-0.9.24.orig/configure tcc-0.9.24/configure
--- tcc-0.9.24.orig/configure 2008-03-31 09:24:00.000000000 +0200
+++ tcc-0.9.24/configure 2008-08-24 07:30:07.000000000 +0200
@@ -120,7 +120,7 @@
;;
--enable-gprof) gprof="yes"
;;
- --enable-mingw32) mingw32="yes" ; cross_prefix="i386-mingw32-"
+ --enable-mingw32) mingw32="yes" ; cross_prefix="i386-mingw32msvc-"
;;
--enable-cross) build_cross="yes"
;;
diff -Nur tcc-0.9.24.orig/cross-configure.sh tcc-0.9.24/cross-configure.sh
--- tcc-0.9.24.orig/cross-configure.sh 1970-01-01 01:00:00.000000000 +0100
+++ tcc-0.9.24/cross-configure.sh 2008-08-24 07:30:07.000000000 +0200
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+CONFIG_SHELL=/bin/sh
+export CONFIG_SHELL
+PREFIX=/opt/mingw
+TARGET=i386-mingw32msvc
+PATH="$PREFIX/bin:$PREFIX/$TARGET/bin:$PATH"
+export PATH
+cache=cross-config.cache
+sh configure --cache-file="$cache" \
+ --target=$TARGET --host=$TARGET --build=i386-linux \
+ "$@"
+status=$?
+rm -f "$cache"
+exit $status
diff -Nur tcc-0.9.24.orig/cross-make.sh tcc-0.9.24/cross-make.sh
--- tcc-0.9.24.orig/cross-make.sh 1970-01-01 01:00:00.000000000 +0100
+++ tcc-0.9.24/cross-make.sh 2008-08-24 07:30:07.000000000 +0200
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+PREFIX=/opt/mingw
+TARGET=i386-mingw32msvc
+PATH="$PREFIX/bin:$PREFIX/$TARGET/bin:$PATH"
+export PATH
+exec make "$@"
diff -Nur tcc-0.9.24.orig/libtcc.h tcc-0.9.24/libtcc.h
--- tcc-0.9.24.orig/libtcc.h 2008-03-31 09:24:00.000000000 +0200
+++ tcc-0.9.24/libtcc.h 2008-08-24 07:30:07.000000000 +0200
@@ -12,6 +12,11 @@
/* create a new TCC compilation context */
TCCState *tcc_new(void);
+#ifdef _WIN32
+/* when libtcc linked to DLL, use this from DllMain() */
+void tcc_set_lib_path(void *module_handle);
+#endif
+
/* free a TCC compilation context */
void tcc_delete(TCCState *s);
diff -Nur tcc-0.9.24.orig/Makefile tcc-0.9.24/Makefile
--- tcc-0.9.24.orig/Makefile 2008-03-31 09:24:00.000000000 +0200
+++ tcc-0.9.24/Makefile 2008-08-24 07:30:07.000000000 +0200
@@ -179,7 +179,7 @@
ifdef CONFIG_WIN32
# for windows, we must use TCC because we generate ELF objects
LIBTCC1_OBJS=$(addprefix win32/lib/, crt1.o wincrt1.o dllcrt1.o dllmain.o chkstk.o) libtcc1.o
-LIBTCC1_CC=./tcc.exe -Bwin32 -DTCC_TARGET_PE
+LIBTCC1_CC=./tcc.exe -Bwin32 -DTCC_TARGET_PE -DWIN32
else
LIBTCC1_OBJS=libtcc1.o
LIBTCC1_CC=$(CC)
@@ -203,28 +203,28 @@
install: tcc_install libinstall
tcc_install: $(PROGS) tcc.1 libtcc1.a $(BCHECK_O) tcc-doc.html
- mkdir -p "$(bindir)"
- $(INSTALL) -s -m755 $(PROGS) "$(bindir)"
+ mkdir -p "$(DESTDIR)$(bindir)"
+ $(INSTALL) -s -m755 $(PROGS) "$(DESTDIR)$(bindir)"
ifndef CONFIG_WIN32
- mkdir -p "$(mandir)/man1"
- $(INSTALL) tcc.1 "$(mandir)/man1"
+ mkdir -p "$(DESTDIR)$(mandir)/man1"
+ $(INSTALL) tcc.1 "$(DESTDIR)$(mandir)/man1"
endif
- mkdir -p "$(tccdir)"
- mkdir -p "$(tccdir)/include"
+ mkdir -p "$(DESTDIR)$(tccdir)"
+ mkdir -p "$(DESTDIR)$(tccdir)/include"
ifdef CONFIG_WIN32
- mkdir -p "$(tccdir)/lib"
- $(INSTALL) -m644 libtcc1.a win32/lib/*.def "$(tccdir)/lib"
- cp -r win32/include/. "$(tccdir)/include"
- cp -r win32/examples/. "$(tccdir)/examples"
+ mkdir -p "$(DESTDIR)$(tccdir)/lib"
+ $(INSTALL) -m644 libtcc1.a win32/lib/*.def "$(DESTDIR)$(tccdir)/lib"
+ cp -r win32/include/. "$(DESTDIR)$(tccdir)/include"
+ cp -r win32/examples/. "$(DESTDIR)$(tccdir)/examples"
else
- $(INSTALL) -m644 libtcc1.a $(BCHECK_O) "$(tccdir)"
+ $(INSTALL) -m644 libtcc1.a $(BCHECK_O) "$(DESTDIR)$(tccdir)"
$(INSTALL) -m644 stdarg.h stddef.h stdbool.h float.h varargs.h \
- tcclib.h "$(tccdir)/include"
+ tcclib.h "$(DESTDIR)$(tccdir)/include"
endif
- mkdir -p "$(docdir)"
- $(INSTALL) -m644 tcc-doc.html "$(docdir)"
+ mkdir -p "$(DESTDIR)$(docdir)"
+ $(INSTALL) -m644 tcc-doc.html "$(DESTDIR)$(docdir)"
ifdef CONFIG_WIN32
- $(INSTALL) -m644 win32/readme.txt "$(docdir)"
+ $(INSTALL) -m644 win32/readme.txt "$(DESTDIR)$(docdir)"
endif
clean:
@@ -242,10 +242,10 @@
# libtcc generation and example
libinstall: libtcc.a
- mkdir -p "$(libdir)"
- $(INSTALL) -m644 libtcc.a "$(libdir)"
- mkdir -p "$(includedir)"
- $(INSTALL) -m644 libtcc.h "$(includedir)"
+ mkdir -p "$(DESTDIR)$(libdir)"
+ $(INSTALL) -m644 libtcc.a "$(DESTDIR)$(libdir)"
+ mkdir -p "$(DESTDIR)$(includedir)"
+ $(INSTALL) -m644 libtcc.h "$(DESTDIR)$(includedir)"
libtcc.o: tcc.c i386-gen.c Makefile
ifdef CONFIG_WIN32
diff -Nur tcc-0.9.24.orig/mingw-cross-build.sh tcc-0.9.24/mingw-cross-build.sh
--- tcc-0.9.24.orig/mingw-cross-build.sh 1970-01-01 01:00:00.000000000 +0100
+++ tcc-0.9.24/mingw-cross-build.sh 2008-08-24 07:30:07.000000000 +0200
@@ -0,0 +1,17 @@
+#!/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 can be fetched from
+# http://www.ch-werner.de/xtools/cross-mingw32-3.1-4.i386.rpm
+# http://www.ch-werner.de/xtools/nsis-2.11-1.i386.rpm
+
+set -e
+
+rm -rf ../TCC
+sh cross-configure.sh --prefix=/TCC --enable-mingw32
+sh cross-make.sh clean all
+sh cross-make.sh DESTDIR=.. install
+sh cross-make.sh distclean
diff -Nur tcc-0.9.24.orig/tcc.c tcc-0.9.24/tcc.c
--- tcc-0.9.24.orig/tcc.c 2008-03-31 09:24:00.000000000 +0200
+++ tcc-0.9.24/tcc.c 2008-08-24 07:30:07.000000000 +0200
@@ -1098,6 +1098,18 @@
*p = 0;
return strdup(path);
}
+
+void tcc_set_lib_path(void *module_handle)
+{
+ static char path[1024];
+ char *p;
+
+ path[0] = '\0';
+ GetModuleFileNameA(module_handle, path, sizeof path);
+ p = tcc_basename(normalize_slashes(strlwr(path)));
+ if (p) *p = 0;
+ tcc_lib_path = path;
+}
#endif
void set_pages_executable(void *ptr, unsigned long length)
@@ -4757,7 +4769,7 @@
#ifdef TCC_TARGET_I386
/* x86 specific: need to pop fp register ST0 if saved */
if (r == TREG_ST0) {
- o(0xd9dd); /* fstp %st(1) */
+ o(0xd8dd); /* fstp %st(0) */
}
#endif
/* special long long case */
@@ -5196,7 +5208,7 @@
#ifdef TCC_TARGET_I386
/* for x86, we need to pop the FP stack */
if (v == TREG_ST0 && !nocode_wanted) {
- o(0xd9dd); /* fstp %st(1) */
+ o(0xd8dd); /* fstp %st(0) */
} else
#endif
if (v == VT_JMP || v == VT_JMPI) {
diff -Nur tcc-0.9.24.orig/win32/include/odbcinst.h tcc-0.9.24/win32/include/odbcinst.h
--- tcc-0.9.24.orig/win32/include/odbcinst.h 1970-01-01 01:00:00.000000000 +0100
+++ tcc-0.9.24/win32/include/odbcinst.h 2007-07-22 16:04:55.000000000 +0200
@@ -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.24.orig/win32/include/sqlext.h tcc-0.9.24/win32/include/sqlext.h
--- tcc-0.9.24.orig/win32/include/sqlext.h 1970-01-01 01:00:00.000000000 +0100
+++ tcc-0.9.24/win32/include/sqlext.h 2007-07-22 16:04:55.000000000 +0200
@@ -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