summaryrefslogtreecommitdiff
path: root/external/mingwheaders/mingw_headers.patch
blob: b6561ff497d1f1291ba6e82ea2b2d90b2353d7f7 (plain)
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
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
--- include/crtdbg.h.orig	2006-09-18 01:21:38.968750000 +0900
+++ include/crtdbg.h	2006-09-02 23:12:50.109375000 +0900
@@ -0,0 +1,11 @@
+#ifndef _CRTDBG_H
+#define _CRTDBG_H
+#if __GNUC__ >=3
+#pragma GCC system_header
+#endif
+
+#ifndef _ASSERTE
+#define _ASSERTE(expr) ((void)0)
+#endif
+
+#endif
--- include/winres.h.orig	2006-07-22 23:41:18.000000000 +0900
+++ include/winres.h	2006-07-22 23:41:18.000000000 +0900
@@ -0,0 +1,13 @@
+#ifndef _WINRES_H
+#define _WINRES_H
+#if __GNUC__ >=3
+#pragma GCC system_header
+#endif
+
+#define VS_VERSION_INFO 1
+#include <winresrc.h>
+#ifdef IDC_STATIC
+#undef IDC_STATIC
+#endif
+#define IDC_STATIC (-1)
+#endif
--- include/excpt.h.orig	2005-01-14 05:19:52.000000000 +0900
+++ include/excpt.h	2006-12-31 09:21:56.000000000 +0900
@@ -16,8 +16,11 @@
 
 /* All the headers include this file. */
 #include <_mingw.h>
+#include <setjmp.h>
+#include <stdarg.h>
 
 #include <windef.h>
+#include <winbase.h>
 
 /*
  * NOTE: The constants structs and typedefs below should be defined in the
@@ -52,7 +55,7 @@
  * The type of function that is expected as an exception handler to be
  * installed with __try1.
  */
-typedef EXCEPTION_DISPOSITION (*PEXCEPTION_HANDLER)
+typedef EXCEPTION_DISPOSITION (* PEXCEPTION_HANDLER)
 		(struct _EXCEPTION_RECORD*, void*, struct _CONTEXT*, void*);
 
 /*
@@ -93,8 +96,122 @@
 	__asm__ ("movl (%%esp),%%eax;movl %%eax,%%fs:0;addl $8,%%esp;" \
 	 : : : "%eax");
 
+WINBASEAPI
+VOID
+WINAPI
+RtlUnwind (
+    IN PVOID TargetFrame OPTIONAL,
+    IN PVOID TargetIp OPTIONAL,
+    IN PEXCEPTION_RECORD ExceptionRecord OPTIONAL,
+    IN PVOID ReturnValue
+    );
 #ifdef	__cplusplus
 }
+
+class __SEHandler
+{
+ public:
+  __SEHandler() {}
+  ~__SEHandler() {}
+  typedef int (*PF)(void *, LPEXCEPTION_POINTERS);
+  typedef void (*PH)(void *, LPEXCEPTION_POINTERS);
+  typedef void (*PN)(void *);
+  void Set(jmp_buf jb, void *pdata=NULL, PF pfilter=NULL, PH phandlerbody=NULL, PN pfinal=NULL)
+    {
+      __builtin_memcpy(m_jmpbuf, jb, sizeof(jmp_buf));
+      m_pData=pdata;
+      switch (reinterpret_cast<int>(pfilter))
+	{
+	default:
+	  m_filter=pfilter;
+	  break;
+	case EXCEPTION_CONTINUE_EXECUTION:
+	  m_filter=DefaultFilterContinueExecution;
+	  break;
+	case EXCEPTION_EXECUTE_HANDLER:
+	  m_filter=DefaultFilterExecuteHandler;
+	  break;
+	case EXCEPTION_CONTINUE_SEARCH:
+	  m_filter=DefaultFilterContinueSearch;
+	  break;
+	}
+      if (phandlerbody)
+	m_handlerbody=phandlerbody;
+      else
+	m_handlerbody=DefaultHandler;
+      if (pfinal)
+	m_final=pfinal;
+      else
+	m_final=DefaultFinal;
+      m_ER.pHandlerClass = this;
+      m_ER.hp = handler;
+      asm("movl %%fs:0, %%eax\n\t"
+	  "movl %%eax, %0": : "m" (m_ER.prev): "%eax" );
+      asm("movl %0, %%eax\n\t"
+	  "movl %%eax, %%fs:0": : "r" (&m_ER): "%eax" );
+    }
+  void Reset()
+    {
+      m_final(m_pData);
+      asm("movl %0, %%eax \n\t"
+	  "movl %%eax, %%fs:0"
+	  : : "m" (m_ER.prev): "%eax");
+    }
+ private:
+  __SEHandler(const __SEHandler&);
+  __SEHandler& operator=(const __SEHandler&);
+  struct _ER {
+    _ER* prev;
+    PEXCEPTION_HANDLER hp;
+    __SEHandler *pHandlerClass;
+  };
+  static EXCEPTION_DISPOSITION handler(
+		     struct _EXCEPTION_RECORD *pExceptionRecord,
+		     void * EstablisherFrame,
+		     struct _CONTEXT *ContextRecord,
+		     void * /*DispatcherContext*/)
+    {
+      __SEHandler* pThis = reinterpret_cast< _ER * >(EstablisherFrame)->pHandlerClass;
+      if ( pExceptionRecord->ExceptionFlags & EH_UNWINDING )
+	{
+	  pThis->m_final(pThis->m_pData);
+	  return ExceptionContinueSearch;
+	}
+      EXCEPTION_POINTERS ep={pExceptionRecord, ContextRecord};
+      switch ( pThis->m_filter(pThis->m_pData, &ep) )
+	{
+	case EXCEPTION_EXECUTE_HANDLER:
+	  RtlUnwind(EstablisherFrame, &&__set_label, pExceptionRecord, 0);
+__set_label:
+	  pThis->m_handlerbody(pThis->m_pData, &ep);
+	  ContextRecord->Ebp = pThis->m_jmpbuf[0];
+	  ContextRecord->Eip = pThis->m_jmpbuf[1];
+	  ContextRecord->Esp = pThis->m_jmpbuf[2];
+	  return ExceptionContinueExecution;
+	case EXCEPTION_CONTINUE_SEARCH:
+	  return ExceptionContinueSearch;
+	case EXCEPTION_CONTINUE_EXECUTION:
+	  return ExceptionContinueExecution;
+	}
+	  return ExceptionContinueExecution;
+    }
+  static int DefaultFilterContinueSearch(void *, LPEXCEPTION_POINTERS) { return EXCEPTION_CONTINUE_SEARCH; }
+  static int DefaultFilterContinueExecution(void *, LPEXCEPTION_POINTERS) { return EXCEPTION_CONTINUE_EXECUTION; }
+  static int DefaultFilterExecuteHandler(void *, LPEXCEPTION_POINTERS) { return EXCEPTION_EXECUTE_HANDLER; }
+  static void DefaultHandler(void *, LPEXCEPTION_POINTERS) {}
+  static void DefaultFinal(void *) {}
+  typedef int (*handler_p)(
+			   struct _EXCEPTION_RECORD *ExceptionRecord,
+			   void * EstablisherFrame,
+			   struct _CONTEXT *ContextRecord,
+			   void * DispatcherContext);
+  _ER m_ER;
+  void *m_pData;
+  PN m_final;
+  PH m_handlerbody;
+  PF m_filter;
+  jmp_buf m_jmpbuf;
+};
 #endif
 
 #endif	/* Not RC_INVOKED */
--- include/tchar.h.orig	2006-03-26 09:21:36.000000000 +0900
+++ include/tchar.h	2006-03-26 09:21:42.000000000 +0900
@@ -223,6 +223,9 @@
 #define _ttelldir	_wtelldir
 #define _tseekdir	_wseekdir
 
+#define _ttempnam	_wtempnam
+
+
 #else	/* Not _UNICODE */
 
 /*
@@ -407,6 +410,8 @@
 #define _ttelldir	telldir
 #define _tseekdir	seekdir
 
+#define _ttempnam	_tempnam
+
 #endif	/* Not _UNICODE */
 
 /*
--- include/amvideo.h.orig	2006-11-19 08:08:30.000000000 +0900
+++ include/amvideo.h	2007-01-16 23:11:24.656250000 +0900
@@ -52,10 +52,10 @@
 	BITMAPINFOHEADER bmiHeader;
 } VIDEOINFOHEADER;
 typedef struct tagVIDEOINFO {
-	RECT rcSource,
-	RECT rcTarget,
-	DWORD dwBitRate,
-	DWORD dwBitErrorRate,
+	RECT rcSource;
+	RECT rcTarget;
+	DWORD dwBitRate;
+	DWORD dwBitErrorRate;
 	REFERENCE_TIME AvgTimePerFrame;
 	BITMAPINFOHEADER bmiHeader;
 	union {
--- include/bdatypes.h.orig	2006-11-19 08:08:30.000000000 +0900
+++ include/bdatypes.h	2007-01-16 23:21:10.062500000 +0900
@@ -17,9 +17,9 @@
 } MEDIA_SAMPLE_CONTENT;
 /*--- DirectShow Reference - DirectShow Structures */
 typedef struct {
-	DWORD dwOffset
-	DWORD dwPacketLength
-	DWORD dwStride
+	DWORD dwOffset;
+	DWORD dwPacketLength;
+	DWORD dwStride;
 } MPEG2_TRANSPORT_STRIDE;
 typedef struct {
 	ULONG ulPID;
--- include/imm.h.orig	2007-12-27 23:07:19.000000000 +0900
+++ include/imm.h	2008-11-08 07:28:48.983375000 +0900
@@ -105,6 +105,7 @@
 #define UI_CAP_ROTANY 4
 #define SCS_CAP_COMPSTR 1
 #define SCS_CAP_MAKEREAD 2
+#define SCS_CAP_SETRECONVERTSTRING 4
 #define SELECT_CAP_CONVERSION 1
 #define SELECT_CAP_SENTENCE 2
 #define GGL_LEVEL 1
@@ -208,6 +209,7 @@
 #define IME_REGWORD_STYLE_USER_FIRST 0x80000000
 #define IME_REGWORD_STYLE_USER_LAST 0xFFFFFFFF
 #define IMR_RECONVERTSTRING 4
+#define IMR_CONFIRMRECONVERTSTRING 5
 #define IMR_QUERYCHARPOSITION 6
 #define SOFTKEYBOARD_TYPE_T1 1
 #define SOFTKEYBOARD_TYPE_C1 2
@@ -285,7 +287,7 @@
   DWORD dwCompStrOffset;
   DWORD dwTargetStrLen;
   DWORD dwTargetStrOffset;
-} RECONVERTSTRING, *PRECONVERTSTRING;
+} RECONVERTSTRING, *PRECONVERTSTRING, *LPRECONVERTSTRING;
 typedef struct tagREGISTERWORDA {
 	LPSTR lpReading;
 	LPSTR lpWord;
--- include/oaidl.h.orig	2006-11-19 08:08:33.000000000 +0900
+++ include/oaidl.h	2007-01-20 09:08:24.625000000 +0900
@@ -78,6 +78,8 @@
 typedef _COM_interface ICreateErrorInfo *LPCREATEERRORINFO;
 typedef _COM_interface ISupportErrorInfo *LPSUPPORTERRORINFO;
 typedef _COM_interface IRecordInfo *LPRECORDINFO;
+typedef _COM_interface IErrorLog *LPERRORLOG;
+typedef _COM_interface IPropertyBag *LPPROPERTYBAG;
 
 extern const IID IID_ITypeLib;
 extern const IID IID_ITypeLib2;
@@ -772,6 +774,29 @@
 };
 #undef INTERFACE
 
+EXTERN_C const IID IID_IErrorLog;
+#define INTERFACE IErrorLog
+DECLARE_INTERFACE_(IErrorLog,IUnknown)
+{
+	STDMETHOD(QueryInterface)(THIS_ REFIID,PVOID*) PURE;
+	STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+	STDMETHOD_(ULONG,Release)(THIS) PURE;
+	STDMETHOD(AddError)(THIS_ LPCOLESTR,LPEXCEPINFO) PURE;
+};
+#undef INTERFACE
+
+EXTERN_C const IID IID_IPropertyBag;
+#define INTERFACE IPropertyBag
+DECLARE_INTERFACE_(IPropertyBag,IUnknown)
+{
+	STDMETHOD(QueryInterface)(THIS_ REFIID,PVOID*) PURE;
+	STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+	STDMETHOD_(ULONG,Release)(THIS) PURE;
+	STDMETHOD(Read)(THIS_ LPCOLESTR,LPVARIANT,LPERRORLOG) PURE;
+	STDMETHOD(Write)(THIS_ LPCOLESTR,LPVARIANT) PURE;
+};
+#undef INTERFACE
+
 #ifdef __cplusplus
 }
 #endif
--- include/objidl.h.orig	2006-11-19 08:08:34.000000000 +0900
+++ include/objidl.h	2008-11-30 11:56:53.875000000 +0900
@@ -1,3 +1,4 @@
+#include <ole2.h>
 #ifndef _OBJIDL_H
 #define _OBJIDL_H
 #if __GNUC__ >= 3
@@ -127,6 +128,7 @@
 	struct IAdviseSink *pAdvSink;
 	DWORD dwConnection;
 } STATDATA;
+#if 0
 typedef struct tagSTATPROPSETSTG {
 	FMTID fmtid;
 	CLSID clsid;
@@ -135,6 +137,7 @@
 	FILETIME ctime;
 	FILETIME atime;
 } STATPROPSETSTG;
+#endif
 typedef enum tagEXTCONN {
 	EXTCONN_STRONG=1,
 	EXTCONN_WEAK=2,
@@ -247,6 +250,7 @@
 typedef enum tagSERVERCALL {
 	SERVERCALL_ISHANDLED,SERVERCALL_REJECTED,SERVERCALL_RETRYLATER
 } SERVERCALL;
+#if 0
 typedef struct tagCAUB {
 	ULONG cElems;
 	unsigned char *pElems;
@@ -406,6 +410,7 @@
 	PROPSETFLAG_DEFAULT,PROPSETFLAG_NONSIMPLE,PROPSETFLAG_ANSI,
 	PROPSETFLAG_UNBUFFERED=4
 } PROPSETFLAG;
+#endif
 typedef struct tagSTORAGELAYOUT {
 	DWORD LayoutType;
 	OLECHAR* pwcsElementName;
@@ -454,8 +459,10 @@
 DECLARE_ENUMERATOR(FORMATETC);
 DECLARE_ENUMERATOR(HLITEM);
 DECLARE_ENUMERATOR(STATDATA);
+#if 0
 DECLARE_ENUMERATOR(STATPROPSETSTG);
 DECLARE_ENUMERATOR(STATPROPSTG);
+#endif
 DECLARE_ENUMERATOR(STATSTG);
 DECLARE_ENUMERATOR_(IEnumString,LPOLESTR);
 DECLARE_ENUMERATOR_(IEnumMoniker,_COM_interface IMoniker*);
@@ -880,8 +887,8 @@
 	STDMETHOD(QueryInterface)(THIS_ REFIID,PVOID*) PURE;
 	STDMETHOD_(ULONG,AddRef)(THIS) PURE;
 	STDMETHOD_(ULONG,Release)(THIS) PURE;
-	STDMETHOD(AddConnection)(THIS_ DWORD,DWORD) PURE;
-	STDMETHOD(ReleaseConnection)(THIS_ DWORD,DWORD,BOOL) PURE;
+	STDMETHOD_(DWORD,AddConnection)(THIS_ DWORD,DWORD) PURE;
+	STDMETHOD_(DWORD,ReleaseConnection)(THIS_ DWORD,DWORD,BOOL) PURE;
 };
 #undef INTERFACE
 
@@ -927,6 +934,7 @@
 };
 #undef INTERFACE
 
+#if 0
 EXTERN_C const IID IID_IPropertyStorage;
 #define INTERFACE IPropertyStorage
 DECLARE_INTERFACE_(IPropertyStorage,IUnknown)
@@ -962,6 +970,7 @@
 	STDMETHOD(Enum)(THIS_ IEnumSTATPROPSETSTG**) PURE;
 };
 #undef INTERFACE
+#endif
 
 EXTERN_C const IID IID_IClientSecurity;
 #define INTERFACE IClientSecurity
--- include/objfwd.h.orig	2006-03-26 09:21:36.000000000 +0900
+++ include/objfwd.h	2006-03-26 09:21:42.000000000 +0900
@@ -27,7 +27,7 @@
 typedef _COM_interface IEnumFORMATETC *LPENUMFORMATETC;
 typedef _COM_interface IEnumSTATDATA *LPENUMSTATDATA;
 typedef _COM_interface IEnumSTATSTG *LPENUMSTATSTG;
-typedef _COM_interface IEnumSTATPROPSTG LPENUMSTATPROPSTG;
+typedef _COM_interface IEnumSTATPROPSTG *LPENUMSTATPROPSTG;
 typedef _COM_interface IEnumString *LPENUMSTRING;
 typedef _COM_interface IEnumUnknown *LPENUMUNKNOWN;
 typedef _COM_interface IStorage *LPSTORAGE;
--- include/uxtheme.h.orig	2006-11-19 08:08:36.000000000 +0900
+++ include/uxtheme.h	2007-01-18 18:51:37.125000000 +0900
@@ -10,7 +10,7 @@
 extern "C" {
 #endif
 
-#if (_WIN32_WINNT >= 0x0501)
+//#if (_WIN32_WINNT >= 0x0501)
 #define DTBG_CLIPRECT 0x00000001
 #define DTBG_DRAWSOLID 0x00000002
 #define DTBG_OMITBORDER 0x00000004
@@ -265,7 +265,7 @@
 HTHEME WINAPI OpenThemeData(HWND,LPCWSTR);
 void WINAPI SetThemeAppProperties(DWORD);
 HRESULT WINAPI SetWindowTheme(HWND,LPCWSTR,LPCWSTR);
-#endif
+//#endif
 
 #ifdef __cplusplus
 }
--- include/winbase.h.orig	2006-11-19 08:08:36.000000000 +0900
+++ include/winbase.h	2007-07-27 21:14:27.621750000 +0900
@@ -993,12 +993,14 @@
 	WORD Reserved2;
 	CHAR szPathName[OFS_MAXPATHNAME];
 } OFSTRUCT,*LPOFSTRUCT,*POFSTRUCT;
+#if 0
 typedef struct _WIN_CERTIFICATE {
       DWORD dwLength;
       WORD wRevision;
       WORD wCertificateType;
       BYTE bCertificate[1];
 } WIN_CERTIFICATE, *LPWIN_CERTIFICATE;
+#endif
 #if (_WIN32_WINNT >= 0x0501)
 typedef struct tagACTCTXA {
 	ULONG cbSize;
@@ -1342,8 +1344,8 @@
 WINBASEAPI HANDLE WINAPI FindFirstFileExW(LPCWSTR,FINDEX_INFO_LEVELS,PVOID,FINDEX_SEARCH_OPS,PVOID,DWORD);
 WINBASEAPI BOOL WINAPI FindFirstFreeAce(PACL,PVOID*);
 #if (_WIN32_WINNT >= 0x0500)
-WINBASEAPI HANDLE WINAPI FindFirstVolumeA(LPCSTR,DWORD);
-WINBASEAPI HANDLE WINAPI FindFirstVolumeW(LPCWSTR,DWORD);
+WINBASEAPI HANDLE WINAPI FindFirstVolumeA(LPSTR,DWORD);
+WINBASEAPI HANDLE WINAPI FindFirstVolumeW(LPWSTR,DWORD);
 WINBASEAPI HANDLE WINAPI FindFirstVolumeMountPointA(LPSTR,LPSTR,DWORD);
 WINBASEAPI HANDLE WINAPI FindFirstVolumeMountPointW(LPWSTR,LPWSTR,DWORD);
 #endif
@@ -1351,7 +1353,7 @@
 WINBASEAPI BOOL WINAPI FindNextFileA(HANDLE,LPWIN32_FIND_DATAA);
 WINBASEAPI BOOL WINAPI FindNextFileW(HANDLE,LPWIN32_FIND_DATAW);
 #if (_WIN32_WINNT >= 0x0500)
-WINBASEAPI BOOL WINAPI FindNextVolumeA(HANDLE,LPCSTR,DWORD);
+WINBASEAPI BOOL WINAPI FindNextVolumeA(HANDLE,LPSTR,DWORD);
 WINBASEAPI BOOL WINAPI FindNextVolumeW(HANDLE,LPWSTR,DWORD);
 WINBASEAPI BOOL WINAPI FindNextVolumeMountPointA(HANDLE,LPSTR,DWORD);
 WINBASEAPI BOOL WINAPI FindNextVolumeMountPointW(HANDLE,LPWSTR,DWORD);
@@ -1463,10 +1465,10 @@
 WINBASEAPI DWORD WINAPI GetLogicalDrives(void);
 WINBASEAPI DWORD WINAPI GetLogicalDriveStringsA(DWORD,LPSTR);
 WINBASEAPI DWORD WINAPI GetLogicalDriveStringsW(DWORD,LPWSTR);
-#if (_WIN32_WINNT >= 0x0500 || _WIN32_WINDOWS >= 0x0410)
+//#if (_WIN32_WINNT >= 0x0500 || _WIN32_WINDOWS >= 0x0410)
 WINBASEAPI DWORD WINAPI GetLongPathNameA(LPCSTR,LPSTR,DWORD);
 WINBASEAPI DWORD WINAPI GetLongPathNameW(LPCWSTR,LPWSTR,DWORD);
-#endif
+//#endif
 WINBASEAPI BOOL WINAPI GetMailslotInfo(HANDLE,PDWORD,PDWORD,PDWORD,PDWORD);
 WINBASEAPI DWORD WINAPI GetModuleFileNameA(HINSTANCE,LPSTR,DWORD);
 WINBASEAPI DWORD WINAPI GetModuleFileNameW(HINSTANCE,LPWSTR,DWORD);
@@ -1504,9 +1506,9 @@
 #endif
 WINBASEAPI HANDLE WINAPI GetProcessHeap(VOID);
 WINBASEAPI DWORD WINAPI GetProcessHeaps(DWORD,PHANDLE);
-#if (_WIN32_WINNT >= 0x0501)
+//#if (_WIN32_WINNT >= 0x0501)
 WINBASEAPI DWORD WINAPI GetProcessId(HANDLE);
-#endif
+//#endif
 #if (_WIN32_WINNT >= 0x0500)
 WINBASEAPI BOOL WINAPI GetProcessIoCounters(HANDLE,PIO_COUNTERS);
 #endif
@@ -1784,9 +1786,9 @@
 WINBASEAPI BOOL WINAPI OpenProcessToken(HANDLE,DWORD,PHANDLE);
 WINBASEAPI HANDLE WINAPI OpenSemaphoreA(DWORD,BOOL,LPCSTR);
 WINBASEAPI HANDLE WINAPI OpenSemaphoreW(DWORD,BOOL,LPCWSTR);
-#if (_WIN32_WINNT >= 0x0500) || (_WIN32_WINDOWS >= 0x0490)
+//#if (_WIN32_WINNT >= 0x0500) || (_WIN32_WINDOWS >= 0x0490)
 WINBASEAPI HANDLE WINAPI OpenThread(DWORD,BOOL,DWORD);
-#endif
+//#endif
 WINBASEAPI BOOL WINAPI OpenThreadToken(HANDLE,DWORD,BOOL,PHANDLE);
 WINBASEAPI HANDLE WINAPI OpenWaitableTimerA(DWORD,BOOL,LPCSTR);
 WINBASEAPI HANDLE WINAPI OpenWaitableTimerW(DWORD,BOOL,LPCWSTR);
@@ -2024,6 +2026,7 @@
 WINBASEAPI BOOL WINAPI WriteProfileStringA(LPCSTR,LPCSTR,LPCSTR);
 WINBASEAPI BOOL WINAPI WriteProfileStringW(LPCWSTR,LPCWSTR,LPCWSTR);
 WINBASEAPI DWORD WINAPI WriteTapemark(HANDLE,DWORD,DWORD,BOOL);
+WINBASEAPI BOOL WINAPI CheckTokenMembership(HANDLE,PSID,PBOOL);
 #define Yield()
 #if (_WIN32_WINNT >= 0x0501)
 WINBASEAPI BOOL WINAPI ZombifyActCtx(HANDLE);
@@ -2130,9 +2133,9 @@
 #define GetFileAttributesEx GetFileAttributesExW
 #define GetFullPathName GetFullPathNameW
 #define GetLogicalDriveStrings GetLogicalDriveStringsW
-#if (_WIN32_WINNT >= 0x0500 || _WIN32_WINDOWS >= 0x0410)
+//#if (_WIN32_WINNT >= 0x0500 || _WIN32_WINDOWS >= 0x0410)
 #define GetLongPathName GetLongPathNameW
-#endif
+//#endif
 #define GetModuleFileName GetModuleFileNameW
 #define GetModuleHandle GetModuleHandleW
 #if (_WIN32_WINNT >= 0x0500)
@@ -2325,9 +2328,9 @@
 #define GetFileAttributesEx GetFileAttributesExA
 #define GetFullPathName GetFullPathNameA
 #define GetLogicalDriveStrings GetLogicalDriveStringsA
-#if (_WIN32_WINNT >= 0x0500 || _WIN32_WINDOWS >= 0x0410)
+//#if (_WIN32_WINNT >= 0x0500 || _WIN32_WINDOWS >= 0x0410)
 #define GetLongPathName GetLongPathNameA
-#endif
+//#endif
 #define GetNamedPipeHandleState GetNamedPipeHandleStateA
 #define GetModuleHandle GetModuleHandleA
 #if (_WIN32_WINNT >= 0x0500)
--- include/wininet.h.orig	2006-03-26 09:21:36.000000000 +0900
+++ include/wininet.h	2006-04-04 23:18:14.000000000 +0900
@@ -868,6 +868,7 @@
 BOOL WINAPI InternetAutodial(DWORD,DWORD);
 BOOL WINAPI InternetAutodialHangup(DWORD);
 BOOL WINAPI InternetGetConnectedState(LPDWORD,DWORD);
+BOOL WINAPI InternetGetConnectedStateEx(LPDWORD,LPTSTR,DWORD,DWORD);
 BOOL WINAPI InternetSetDialState(LPCTSTR,DWORD,DWORD);
 BOOL WINAPI InternetReadFileExA(HINTERNET,LPINTERNET_BUFFERSA,DWORD,DWORD_PTR);
 BOOL WINAPI InternetReadFileExW(HINTERNET,LPINTERNET_BUFFERSW,DWORD,DWORD_PTR);
--- include/winnt.h.orig	2006-11-19 08:08:37.000000000 +0900
+++ include/winnt.h	2007-01-16 07:06:57.796875000 +0900
@@ -67,9 +67,9 @@
 #endif
 #endif
 
-#ifndef C_ASSERT
-#define C_ASSERT(expr) typedef char __C_ASSERT__[(expr)?1:-1]
-#endif
+//#ifndef C_ASSERT
+//#define C_ASSERT(expr) typedef char __C_ASSERT__[(expr)?1:-1]
+//#endif
 
 #ifndef VOID
 #define VOID void
--- include/winver.h.orig	2006-03-26 09:21:36.000000000 +0900
+++ include/winver.h	2006-03-26 09:21:42.000000000 +0900
@@ -101,10 +101,10 @@
 DWORD WINAPI VerFindFileW(DWORD,LPWSTR,LPWSTR,LPWSTR,LPWSTR,PUINT,LPWSTR,PUINT);
 DWORD WINAPI VerInstallFileA(DWORD,LPSTR,LPSTR,LPSTR,LPSTR,LPSTR,LPSTR,PUINT);
 DWORD WINAPI VerInstallFileW(DWORD,LPWSTR,LPWSTR,LPWSTR,LPWSTR,LPWSTR,LPWSTR,PUINT);
-DWORD WINAPI GetFileVersionInfoSizeA(LPCSTR,PDWORD);
-DWORD WINAPI GetFileVersionInfoSizeW(LPCWSTR,PDWORD);
-BOOL WINAPI GetFileVersionInfoA(LPCSTR,DWORD,DWORD,PVOID);
-BOOL WINAPI GetFileVersionInfoW(LPCWSTR,DWORD,DWORD,PVOID);
+DWORD WINAPI GetFileVersionInfoSizeA(LPSTR,PDWORD);
+DWORD WINAPI GetFileVersionInfoSizeW(LPWSTR,PDWORD);
+BOOL WINAPI GetFileVersionInfoA(LPSTR,DWORD,DWORD,PVOID);
+BOOL WINAPI GetFileVersionInfoW(LPWSTR,DWORD,DWORD,PVOID);
 DWORD WINAPI VerLanguageNameA(DWORD,LPSTR,DWORD);
 DWORD WINAPI VerLanguageNameW(DWORD,LPWSTR,DWORD);
 BOOL WINAPI VerQueryValueA(const LPVOID,LPSTR,LPVOID*,PUINT);
--- include/wtypes.h.orig	2006-11-19 08:08:37.000000000 +0900
+++ include/wtypes.h	2007-01-19 23:05:02.531250000 +0900
@@ -66,6 +66,19 @@
 	unsigned short asData[1];
 }FLAGGED_WORD_BLOB;
 
+typedef struct _COAUTHIDENTITY
+    {
+    /* [size_is] */ USHORT *User;
+    /* [range] */ ULONG UserLength;
+    /* [size_is] */ USHORT *Domain;
+    /* [range] */ ULONG DomainLength;
+    /* [size_is] */ USHORT *Password;
+    /* [range] */ ULONG PasswordLength;
+    ULONG Flags;
+    } 	COAUTHIDENTITY;
+
+typedef WORD CLIPFORMAT,*LPCLIPFORMAT;
+
 #ifndef OLE2ANSI
 typedef WCHAR OLECHAR;
 typedef LPWSTR LPOLESTR;
@@ -94,6 +107,7 @@
 	}_STRUCT_NAME(s);
 	LONGLONG int64;
 } CY;
+typedef union tagCY *LPCY;
 typedef double DATE;
 typedef struct  tagBSTRBLOB {
 	ULONG cbSize;
@@ -165,6 +179,52 @@
 #define DECIMAL_SETZERO(d) {(d).Lo64=(d).Hi32=(d).signscale=0;}
 #endif
 typedef void *HMETAFILEPICT;
+
+typedef enum tagTYSPEC {
+    TYSPEC_CLSID, 
+    TYSPEC_FILEEXT,
+    TYSPEC_MIMETYPE,
+    TYSPEC_FILENAME,
+    TYSPEC_PROGID,
+    TYSPEC_PACKAGENAME,
+    TYSPEC_OBJECTID
+} TYSPEC;
+
+typedef union {
+        CLSID clsid;
+        LPOLESTR pFileExt;
+        LPOLESTR pMimeType;
+        LPOLESTR pProgId;
+        LPOLESTR pFileName;
+        struct {
+        LPOLESTR pPackageName;
+        GUID PolicyId;
+        } ByName;
+        struct {
+        GUID ObjectId;
+        GUID PolicyId;
+        } ByObjectId;
+} uCLSSPEC;
+
+typedef struct tagCSPLATFORM {
+   DWORD dwContext;
+   DWORD dwVersionHi;
+   DWORD dwVersionLo;
+   DWORD dwProcessorArch;
+} CSPLATFORM;
+
+typedef struct tagQUERYCONTEXT {
+  DWORD dwContext;
+  CSPLATFORM Platform;
+  LCID Locale;
+  DWORD dwVersionHi;
+  DWORD dwVersionLo;
+} QUERYCONTEXT;
+typedef struct
+{
+	GUID fmtid;
+	DWORD pid;
+} PROPERTYKEY;
 #ifdef __cplusplus
 }
 #endif
--- include/sys/stat.h.orig	2006-06-25 19:45:42.000000000 +0900
+++ include/sys/stat.h	2006-12-30 18:26:27.578125000 +0900
@@ -11,6 +11,9 @@
 
 #ifndef _STAT_H_
 #define _STAT_H_
+#if __GNUC__ >=3
+#pragma GCC system_header
+#endif
 
 /* All the headers include this file. */
 #include <_mingw.h>
--- include/adoctint.h.orig	2005-04-04 18:50:18.000000000 +0900
+++ include/adoctint.h	2007-12-14 23:43:07.754125000 +0900
@@ -11,6 +11,9 @@
 //--------------------------------------------------------------------
 #ifndef _ADOCTINT_H_
 #define _ADOCTINT_H_
+#if __GNUC__ >=3
+#pragma GCC system_header
+#endif
 
 #ifndef _INC_TCHAR
 #include <tchar.h>
@@ -2489,11 +2492,11 @@
 #endif 	/* __Procedure_INTERFACE_DEFINED__ */
 EXTERN_C const CLSID CLSID_Catalog;
 #ifdef __cplusplus
-Catalog;
+//Catalog;
 #endif
 EXTERN_C const CLSID CLSID_Table;
 #ifdef __cplusplus
-Table;
+//Table;
 #endif
 #ifndef __Property_INTERFACE_DEFINED__
 #define __Property_INTERFACE_DEFINED__
@@ -2635,23 +2638,23 @@
 #endif 	/* __Property_INTERFACE_DEFINED__ */
 EXTERN_C const CLSID CLSID_Group;
 #ifdef __cplusplus
-Group;
+//Group;
 #endif
 EXTERN_C const CLSID CLSID_User;
 #ifdef __cplusplus
-User;
+//User;
 #endif
 EXTERN_C const CLSID CLSID_Column;
 #ifdef __cplusplus
-Column;
+//Column;
 #endif
 EXTERN_C const CLSID CLSID_Index;
 #ifdef __cplusplus
-Index;
+//Index;
 #endif
 EXTERN_C const CLSID CLSID_Key;
 #ifdef __cplusplus
-Key;
+//Key;
 #endif
 #ifndef __Tables_INTERFACE_DEFINED__
 #define __Tables_INTERFACE_DEFINED__
@@ -3332,8 +3335,8 @@
             /* [in] */ VARIANT Item,
             /* [defaultvalue][in] */ KeyTypeEnum Type,
             /* [optional][in] */ VARIANT Column,
-            /* [defaultvalue][in] */ __RPC__in BSTR RelatedADOTable = L"",
-            /* [defaultvalue][in] */ __RPC__in BSTR RelatedADOColumn = L"") = 0;
+            /* [defaultvalue][in] */ __RPC__in BSTR RelatedADOTable = const_cast<BSTR>(L""),
+            /* [defaultvalue][in] */ __RPC__in BSTR RelatedADOColumn = const_cast<BSTR>(L"")) = 0;
         
         virtual /* [helpcontext] */ HRESULT STDMETHODCALLTYPE Delete( 
             /* [in] */ VARIANT Item) = 0;
--- include/adodef.h.orig	2005-04-04 18:50:18.000000000 +0900
+++ include/adodef.h	2007-01-05 21:48:51.265625000 +0900
@@ -12,6 +12,9 @@
 
 #ifndef _ADODEF_H_
 #define _ADODEF_H_
+#if __GNUC__ >=3
+#pragma GCC system_header
+#endif
 
 // TYPELIB MAJOR VERSIONS
 #define ADO_MAJOR			6
--- include/adoguids.h.orig	2005-04-04 18:50:18.000000000 +0900
+++ include/adoguids.h	2007-01-05 21:50:10.265625000 +0900
@@ -11,6 +11,10 @@
 //-----------------------------------------------------------------------------
 
 
+#if __GNUC__ >=3
+#pragma GCC system_header
+#endif
+
 #define STRING_GUID(l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) l##-##w1##-##w2##-##b1##b2##-##b3##b4##b5##b6##b7##b8
 
 #if defined(__midl) || defined(GEN_MIDL)
--- include/adoint.h.orig	2005-04-04 18:50:18.000000000 +0900
+++ include/adoint.h	2007-01-02 17:36:43.593750000 +0900
@@ -11,6 +11,9 @@
 //--------------------------------------------------------------------
 #ifndef _ADOINT_H_
 #define _ADOINT_H_
+#if __GNUC__ >=3
+#pragma GCC system_header
+#endif
 
 #ifndef _INC_TCHAR
 #include <tchar.h>
@@ -3494,7 +3497,7 @@
 #endif 	/* __ADOConnectionConstruction_INTERFACE_DEFINED__ */
 EXTERN_C const CLSID CLSID_Connection;
 #ifdef __cplusplus
-Connection;
+//Connection;
 #endif
 #ifndef ___Record_INTERFACE_DEFINED__
 #define ___Record_INTERFACE_DEFINED__
@@ -3793,7 +3796,7 @@
 #endif 	/* ___Record_INTERFACE_DEFINED__ */
 EXTERN_C const CLSID CLSID_Record;
 #ifdef __cplusplus
-Record;
+//Record;
 #endif
 #ifndef ___Stream_INTERFACE_DEFINED__
 #define ___Stream_INTERFACE_DEFINED__
@@ -4123,7 +4126,7 @@
 #endif 	/* ___Stream_INTERFACE_DEFINED__ */
 EXTERN_C const CLSID CLSID_Stream;
 #ifdef __cplusplus
-Stream;
+//Stream;
 #endif
 #ifndef __ADORecordConstruction_INTERFACE_DEFINED__
 #define __ADORecordConstruction_INTERFACE_DEFINED__
@@ -4405,11 +4408,11 @@
 #endif 	/* __ADOCommandConstruction_INTERFACE_DEFINED__ */
 EXTERN_C const CLSID CLSID_Command;
 #ifdef __cplusplus
-Command;
+//Command;
 #endif
 EXTERN_C const CLSID CLSID_Recordset;
 #ifdef __cplusplus
-Recordset;
+//Recordset;
 #endif
 #ifndef __Recordset15_INTERFACE_DEFINED__
 #define __Recordset15_INTERFACE_DEFINED__
@@ -8305,7 +8308,7 @@
 #endif 	/* ___Parameter_INTERFACE_DEFINED__ */
 EXTERN_C const CLSID CLSID_Parameter;
 #ifdef __cplusplus
-Parameter;
+//Parameter;
 #endif
 #ifndef __Parameters_INTERFACE_DEFINED__
 #define __Parameters_INTERFACE_DEFINED__
--- include/bcrypt.h.orig	2008-01-18 22:17:12.000000000 +0900
+++ include/bcrypt.h	2008-04-10 22:57:54.410750000 +0900
@@ -40,12 +40,6 @@
 #define OPTIONAL
 #endif
 
-#if !defined(__midl)
-#define BCRYPT_STRUCT_ALIGNMENT __declspec(align(BCRYPT_OBJECT_ALIGNMENT))
-#else
-#define BCRYPT_STRUCT_ALIGNMENT
-#endif /*!defined(__midl)*/
-
 //
 //  Alignment macros
 //
@@ -57,11 +51,7 @@
  #define BCRYPT_OBJECT_ALIGNMENT    4
 #endif
 
-#if !defined(__midl)
-#define BCRYPT_STRUCT_ALIGNMENT __declspec(align(BCRYPT_OBJECT_ALIGNMENT))
-#else
 #define BCRYPT_STRUCT_ALIGNMENT
-#endif /*!defined(__midl)*/
 
 //
 // DeriveKey KDF Types
@@ -108,7 +98,11 @@
 
 typedef BCRYPT_KEY_LENGTHS_STRUCT BCRYPT_AUTH_TAG_LENGTHS_STRUCT;
 
-#pragma pack(push, BCRYPT_OBJECT_ALIGNMENT)
+#if defined(_IA64_) || defined(_AMD64_)
+#pragma pack(push, 8)
+#else
+#pragma pack(push, 4)
+#endif
 typedef BCRYPT_STRUCT_ALIGNMENT struct _BCRYPT_OID
 {
     ULONG   cbOID;
--- include/commctrl.h.orig	2008-01-18 22:17:14.000000000 +0900
+++ include/commctrl.h	2008-03-27 00:30:22.281000000 +0900
@@ -14,6 +14,14 @@
 #ifndef _INC_COMMCTRL
 #define _INC_COMMCTRL
 
+#define __in
+#define __out
+#ifdef __cplusplus
+#define __inline inline
+#else
+#define __inline static
+#endif
+
 #if defined(_MSC_VER) && (_MSC_VER >= 1200)
 #pragma warning(push)
 #pragma warning(disable:4001) /* nonstandard extension : single line comment */
@@ -23,7 +31,7 @@
 
 #ifndef _HRESULT_DEFINED
 #define _HRESULT_DEFINED
-typedef __success(return >= 0) long HRESULT;
+typedef long HRESULT;
 #endif // !_HRESULT_DEFINED
 
 #ifndef NOUSER
@@ -369,8 +377,10 @@
 
 // Shell reserved               (0U-580U) -  (0U-589U)
 
+#ifndef CDN_FIRST
 #define CDN_FIRST               (0U-601U)       // common dialog (new)
 #define CDN_LAST                (0U-699U)
+#endif
 
 #define TBN_FIRST               (0U-700U)       // toolbar
 #define TBN_LAST                (0U-720U)
@@ -683,7 +693,7 @@
 #define ILP_DOWNLEVEL       1           // Write or reads the stream using downlevel sematics.
 
 
-WINCOMMCTRLAPI HRESULT WINAPI ImageList_ReadEx(DWORD dwFlags, LPSTREAM pstm, REFIID riid, PVOID* ppv);
+//WINCOMMCTRLAPI HRESULT WINAPI ImageList_ReadEx(DWORD dwFlags, LPSTREAM pstm, REFIID riid, PVOID* ppv);
 WINCOMMCTRLAPI HRESULT WINAPI ImageList_WriteEx(HIMAGELIST himl, DWORD dwFlags, LPSTREAM pstm);
 #endif
 
@@ -713,7 +723,7 @@
 #endif
 
 #if (_WIN32_WINNT >= 0x0501)
-WINCOMMCTRLAPI HRESULT WINAPI HIMAGELIST_QueryInterface(HIMAGELIST himl, REFIID riid, void** ppv);
+//WINCOMMCTRLAPI HRESULT WINAPI HIMAGELIST_QueryInterface(HIMAGELIST himl, REFIID riid, void** ppv);
 
 #ifdef __cplusplus
 FORCEINLINE HIMAGELIST IImageListToHIMAGELIST(struct IImageList *himl)
@@ -8056,8 +8066,10 @@
 #if (_WIN32_WINNT >= 0x0501)
 
 // custom combobox control messages
+#ifndef CB_SETMINVISIBLE
 #define CB_SETMINVISIBLE        (CBM_FIRST + 1)
 #define CB_GETMINVISIBLE        (CBM_FIRST + 2)
+#endif
 #define CB_SETCUEBANNER         (CBM_FIRST + 3)
 #define CB_GETCUEBANNER         (CBM_FIRST + 4)
 
@@ -8651,7 +8663,7 @@
 
 #if !defined(RC_INVOKED) /* RC complains about long symbols in #ifs */
 #if defined(ISOLATION_AWARE_ENABLED) && (ISOLATION_AWARE_ENABLED != 0)
-#include "commctrl.inl"
+//#include "commctrl.inl"
 #endif /* ISOLATION_AWARE_ENABLED */
 #endif /* RC */
 
@@ -8666,6 +8678,10 @@
 #pragma warning(pop)
 #endif
 
+#undef __in
+#undef __out
+#undef __inline
+
 #endif  /* _INC_COMMCTRL */
 
 
--- include/control.h.orig	2005-04-14 17:54:38.000000000 +0900
+++ include/control.h	2007-01-02 22:16:33.031250000 +0900
@@ -1,3 +1,6 @@
+#if __GNUC__ >=3
+#pragma GCC system_header
+#endif
 
 
 /* this ALWAYS GENERATED file contains the definitions for the interfaces */
--- include/dispex.h.orig	2007-03-31 19:44:54.000000000 +0900
+++ include/dispex.h	2007-03-24 17:40:20.000000000 +0900
@@ -1,3 +1,6 @@
+#if __GNUC__ >=3
+#pragma GCC system_header
+#endif
 
 
 /* this ALWAYS GENERATED file contains the definitions for the interfaces */
--- include/filter.h.orig	2005-04-14 17:54:44.000000000 +0900
+++ include/filter.h	2007-01-02 11:15:03.671875000 +0900
@@ -1,3 +1,6 @@
+#if __GNUC__ >=3
+#pragma GCC system_header
+#endif
 
 
 /* this ALWAYS GENERATED file contains the definitions for the interfaces */
--- include/gdiplusbitmap.h.orig	2005-04-14 17:54:44.000000000 +0900
+++ include/gdiplusbitmap.h	2007-01-02 11:17:13.125000000 +0900
@@ -1,3 +1,6 @@
+#if __GNUC__ >=3
+#pragma GCC system_header
+#endif
 /**************************************************************************\
 *
 * Copyright (c) 1998-2001, Microsoft Corp.  All Rights Reserved.
--- include/gdiplusbrush.h.orig	2005-04-14 17:54:44.000000000 +0900
+++ include/gdiplusbrush.h	2007-01-02 10:33:22.734375000 +0900
@@ -1,3 +1,6 @@
+#if __GNUC__ >=3
+#pragma GCC system_header
+#endif
 /**************************************************************************\
 * 
 * Copyright (c) 1998-2001, Microsoft Corp.  All Rights Reserved.
--- include/gdiplusenums.h.orig	2003-03-26 16:34:34.000000000 +0900
+++ include/gdiplusenums.h	2004-12-30 20:42:34.000000000 +0900
@@ -542,7 +542,7 @@
 
 #define GDIP_EMFPLUS_RECORD_BASE        0x00004000
 #define GDIP_WMF_RECORD_BASE            0x00010000
-#define GDIP_WMF_RECORD_TO_EMFPLUS(n)   ((EmfPlusRecordType)((n) | GDIP_WMF_RECORD_BASE))
+#define GDIP_WMF_RECORD_TO_EMFPLUS(n)   ((n) | GDIP_WMF_RECORD_BASE)
 #define GDIP_EMFPLUS_RECORD_TO_WMF(n)   ((n) & (~GDIP_WMF_RECORD_BASE))
 #define GDIP_IS_WMF_RECORDTYPE(n)       (((n) & GDIP_WMF_RECORD_BASE) != 0)
 
--- include/gdiplusfont.h.orig	2005-04-14 17:54:44.000000000 +0900
+++ include/gdiplusfont.h	2007-01-02 10:35:57.671875000 +0900
@@ -1,3 +1,6 @@
+#if __GNUC__ >=3
+#pragma GCC system_header
+#endif
 /**************************************************************************\
 *
 * Copyright (c) 1998-2001, Microsoft Corp.  All Rights Reserved.
--- include/gdiplusheaders.h.orig	2008-01-18 22:17:46.000000000 +0900
+++ include/gdiplusheaders.h	2008-03-28 21:44:34.907750000 +0900
@@ -704,7 +704,7 @@
 
 class CachedBitmap : public GdiplusBase
 {
-    friend Graphics;
+    friend class Graphics;
 
 public:
     CachedBitmap(IN Bitmap *bitmap,
@@ -888,7 +888,7 @@
 
     UINT GetDownLevelRasterizationLimit() const;
 
-    static UINT Metafile::EmfToWmfBits(
+    static UINT EmfToWmfBits(
         IN HENHMETAFILE       hemf,
         IN UINT               cbData16,     
         OUT LPBYTE            pData16,
--- include/gdiplusimageattributes.h.orig	2005-04-14 17:54:44.000000000 +0900
+++ include/gdiplusimageattributes.h	2007-01-02 10:21:23.031250000 +0900
@@ -32,6 +32,9 @@
 
 #ifndef _GDIPLUSIMAGEATTRIBUTES_H
 #define _GDIPLUSIMAGEATTRIBUTES_H
+#if __GNUC__ >=3
+#pragma GCC system_header
+#endif
 
 class GpImageAttributes;
 
--- include/gdiplusimaging.h.orig	2003-03-26 16:34:34.000000000 +0900
+++ include/gdiplusimaging.h	2007-12-04 21:16:38.000000000 +0900
@@ -160,7 +160,7 @@
     UINT Width;
     UINT Height;
     INT Stride;
-    PixelFormat PixelFormat;
+    ::Gdiplus::PixelFormat PixelFormat;
     VOID* Scan0;
     UINT_PTR Reserved;
 };
--- include/gdiplusmatrix.h.orig	2005-04-14 17:54:44.000000000 +0900
+++ include/gdiplusmatrix.h	2007-01-02 10:32:35.203125000 +0900
@@ -1,3 +1,6 @@
+#if __GNUC__ >=3
+#pragma GCC system_header
+#endif
 /**************************************************************************\
 * 
 * Copyright (c) 1998-2001, Microsoft Corp.  All Rights Reserved.
--- include/gdipluspath.h.orig	2005-04-14 17:54:44.000000000 +0900
+++ include/gdipluspath.h	2007-01-02 10:34:33.125000000 +0900
@@ -1,3 +1,6 @@
+#if __GNUC__ >=3
+#pragma GCC system_header
+#endif
 /**************************************************************************\
 *
 * Copyright (c) 1998-2001, Microsoft Corp.  All Rights Reserved.
--- include/gdipluspen.h.orig	2005-04-14 17:54:44.000000000 +0900
+++ include/gdipluspen.h	2007-01-02 10:34:12.593750000 +0900
@@ -1,3 +1,6 @@
+#if __GNUC__ >=3
+#pragma GCC system_header
+#endif
 /**************************************************************************\
 * 
 * Copyright (c) 1998-2001, Microsoft Corp.  All Rights Reserved.
--- include/gdiplusregion.h.orig	2005-04-14 17:54:44.000000000 +0900
+++ include/gdiplusregion.h	2007-01-02 10:35:23.453125000 +0900
@@ -1,3 +1,6 @@
+#if __GNUC__ >=3
+#pragma GCC system_header
+#endif
 /**************************************************************************\
 *
 * Copyright (c) 1998-2001, Microsoft Corp.  All Rights Reserved.
--- include/gdiplusstringformat.h.orig	2005-04-14 17:54:44.000000000 +0900
+++ include/gdiplusstringformat.h	2007-08-29 23:10:06.497500000 +0900
@@ -217,7 +217,7 @@
         ));
     }
 
-    StringTrimming StringFormat::GetTrimming() const
+    StringTrimming GetTrimming() const
     {
         StringTrimming trimming;
         SetStatus(DllExports::GdipGetStringFormatTrimming(
--- include/imagehlp.h.orig	2008-03-22 06:10:42.084500000 +1000
+++ include/imagehlp.h	2008-03-24 02:29:51.398250000 +1000
@@ -1,3 +1,6 @@
+#if __GNUC__ >=3
+#pragma GCC system_header
+#endif
 /*++ BUILD Version: 0000     Increment this if a change has global effects
 
 Copyright (c) Microsoft Corporation. All rights reserved.
@@ -59,6 +62,13 @@
 #include <wintrust.h>
 #endif
 
+#define __in
+#define __out
+#ifdef __cplusplus
+#define __inline inline
+#else
+#define __inline static
+#endif
 
 #ifdef __cplusplus
 extern "C" {
@@ -407,7 +417,7 @@
 IMAGEAPI
 TouchFileTimes (
     __in HANDLE FileHandle,
-    __in_opt PSYSTEMTIME pSystemTime
+    __in_opt LPSYSTEMTIME pSystemTime
     );
 
 BOOL
@@ -3950,7 +3960,7 @@
 // ThreadId must be 4 bytes on all architectures.
 //
 
-C_ASSERT (sizeof ( ((PPROCESS_INFORMATION)0)->dwThreadId ) == 4);
+//C_ASSERT (sizeof ( ((PPROCESS_INFORMATION)0)->dwThreadId ) == 4);
 
 typedef struct _MINIDUMP_THREAD {
     ULONG32 ThreadId;
@@ -4684,5 +4694,9 @@
 #endif
 
 
+#undef __in
+#undef __out
+#undef __inline
+
 #endif // _IMAGEHLP_
 
--- include/intsafe.h.orig	2008-03-22 06:10:42.100125000 +1000
+++ include/intsafe.h	2008-03-24 02:25:53.710750000 +1000
@@ -111,7 +111,7 @@
 
 
 
-typedef __success(return >= 0) long HRESULT;
+typedef long HRESULT;
 
 #define SUCCEEDED(hr)   (((HRESULT)(hr)) >= 0)
 #define FAILED(hr)      (((HRESULT)(hr)) < 0)
@@ -134,7 +134,7 @@
     || defined(_M_IA64) || defined(_M_AMD64)
 #define UInt32x32To64(a, b) (((unsigned __int64)((unsigned int)(a))) * ((unsigned __int64)((unsigned int)(b))))
 #elif defined(_M_IX86)
-#define UInt32x32To64(a, b) ((unsigned __int64)(((unsigned __int64)((unsigned int)(a))) * ((unsigned int)(b))))
+//#define UInt32x32To64(a, b) ((unsigned __int64)(((unsigned __int64)((unsigned int)(a))) * ((unsigned int)(b))))
 #else
 #error Must define a target architecture.
 #endif
@@ -142,22 +142,22 @@
 //
 // Min/Max type values
 //
-#define INT8_MIN        (-127i8 - 1)
+#define INT8_MIN        ((signed char)(-127) - 1)
 #define SHORT_MIN       (-32768)
-#define INT16_MIN       (-32767i16 - 1)
-#define INT_MIN         (-2147483647 - 1)
-#define INT32_MIN       (-2147483647i32 - 1)
-#define LONG_MIN        (-2147483647L - 1)
-#define LONGLONG_MIN    (-9223372036854775807i64 - 1)
-#define LONG64_MIN      (-9223372036854775807i64 - 1)
-#define INT64_MIN       (-9223372036854775807i64 - 1)
+#define INT16_MIN       ((short)(-32767) - 1)
+//#define INT_MIN         (-2147483647 - 1)
+#define INT32_MIN       (-2147483647L - 1)
+//#define LONG_MIN        (-2147483647L - 1)
+#define LONGLONG_MIN    (-9223372036854775807ll - 1)
+#define LONG64_MIN      (-9223372036854775807ll - 1)
+#define INT64_MIN       (-9223372036854775807ll - 1)
 #define INT128_MIN      (-170141183460469231731687303715884105727i128 - 1)
 
 #ifdef _WIN64
-#define INT_PTR_MIN     (-9223372036854775807i64 - 1)
-#define LONG_PTR_MIN    (-9223372036854775807i64 - 1)
-#define PTRDIFF_T_MIN   (-9223372036854775807i64 - 1)
-#define SSIZE_T_MIN     (-9223372036854775807i64 - 1)
+#define INT_PTR_MIN     (-9223372036854775807ll - 1)
+#define LONG_PTR_MIN    (-9223372036854775807ll - 1)
+#define PTRDIFF_T_MIN   (-9223372036854775807ll - 1)
+#define SSIZE_T_MIN     (-9223372036854775807ll - 1)
 #else
 #define INT_PTR_MIN     (-2147483647 - 1)
 #define LONG_PTR_MIN    (-2147483647L - 1)
@@ -165,44 +165,44 @@
 #define SSIZE_T_MIN     (-2147483647L - 1)
 #endif
 
-#define INT8_MAX        127i8
-#define UINT8_MAX       0xffui8
+#define INT8_MAX        ((signed char)(127))
+#define UINT8_MAX       ((unsigned char)(0xff))
 #define BYTE_MAX        0xff
 #define SHORT_MAX       32767
-#define INT16_MAX       32767i16
+#define INT16_MAX       ((short)(32767))
 #define USHORT_MAX      0xffff
-#define UINT16_MAX      0xffffui16
+#define UINT16_MAX      ((unsigned short)(0xffff))
 #define WORD_MAX        0xffff
 #define INT_MAX         2147483647
-#define INT32_MAX       2147483647i32
+#define INT32_MAX       2147483647L
 #define UINT_MAX        0xffffffff
-#define UINT32_MAX      0xffffffffui32
+#define UINT32_MAX      0xffffffffu
 #define LONG_MAX        2147483647L
 #define ULONG_MAX       0xffffffffUL
 #define DWORD_MAX       0xffffffffUL
-#define LONGLONG_MAX    9223372036854775807i64
-#define LONG64_MAX      9223372036854775807i64
-#define INT64_MAX       9223372036854775807i64
-#define ULONGLONG_MAX   0xffffffffffffffffui64
-#define DWORDLONG_MAX   0xffffffffffffffffui64
-#define ULONG64_MAX     0xffffffffffffffffui64
-#define DWORD64_MAX     0xffffffffffffffffui64
-#define UINT64_MAX      0xffffffffffffffffui64
+#define LONGLONG_MAX    9223372036854775807ll
+#define LONG64_MAX      9223372036854775807ll
+#define INT64_MAX       9223372036854775807ll
+#define ULONGLONG_MAX   0xffffffffffffffffull
+#define DWORDLONG_MAX   0xffffffffffffffffull
+#define ULONG64_MAX     0xffffffffffffffffull
+#define DWORD64_MAX     0xffffffffffffffffull
+#define UINT64_MAX      0xffffffffffffffffull
 #define INT128_MAX      170141183460469231731687303715884105727i128
 #define UINT128_MAX     0xffffffffffffffffffffffffffffffffui128
 
 #undef SIZE_T_MAX
 
 #ifdef _WIN64
-#define INT_PTR_MAX     9223372036854775807i64
-#define UINT_PTR_MAX    0xffffffffffffffffui64
-#define LONG_PTR_MAX    9223372036854775807i64
-#define ULONG_PTR_MAX   0xffffffffffffffffui64
-#define DWORD_PTR_MAX   0xffffffffffffffffui64
-#define PTRDIFF_T_MAX   9223372036854775807i64
-#define SIZE_T_MAX      0xffffffffffffffffui64
-#define SSIZE_T_MAX     9223372036854775807i64
-#define _SIZE_T_MAX     0xffffffffffffffffui64
+#define INT_PTR_MAX     9223372036854775807ll
+#define UINT_PTR_MAX    0xffffffffffffffffull
+#define LONG_PTR_MAX    9223372036854775807ll
+#define ULONG_PTR_MAX   0xffffffffffffffffull
+#define DWORD_PTR_MAX   0xffffffffffffffffull
+#define PTRDIFF_T_MAX   9223372036854775807ll
+#define SIZE_T_MAX      0xffffffffffffffffull
+#define SSIZE_T_MAX     9223372036854775807ll
+#define _SIZE_T_MAX     0xffffffffffffffffull
 #else
 #define INT_PTR_MAX     2147483647 
 #define UINT_PTR_MAX    0xffffffff
@@ -219,39 +219,39 @@
 //
 // It is common for -1 to be used as an error value
 //
-#define INT8_ERROR      (-1i8)
-#define UINT8_ERROR     0xffui8
+#define INT8_ERROR      (((signed char)(-1)))
+#define UINT8_ERROR     ((unsigned char)(0xff))
 #define BYTE_ERROR      0xff
 #define SHORT_ERROR     (-1)
-#define INT16_ERROR     (-1i16)
+#define INT16_ERROR     (((short)(-1)))
 #define USHORT_ERROR    0xffff
-#define UINT16_ERROR    0xffffui16
+#define UINT16_ERROR    ((unsigned short)(0xffff))
 #define WORD_ERROR      0xffff
 #define INT_ERROR       (-1)
-#define INT32_ERROR     (-1i32)
+#define INT32_ERROR     (-1L)
 #define UINT_ERROR      0xffffffff
-#define UINT32_ERROR    0xffffffffui32
+#define UINT32_ERROR    0xffffffffuL
 #define LONG_ERROR      (-1L)
 #define ULONG_ERROR     0xffffffffUL
 #define DWORD_ERROR     0xffffffffUL
-#define LONGLONG_ERROR  (-1i64)
-#define LONG64_ERROR    (-1i64)
-#define INT64_ERROR     (-1i64)
-#define ULONGLONG_ERROR 0xffffffffffffffffui64
-#define DWORDLONG_ERROR 0xffffffffffffffffui64
-#define ULONG64_ERROR   0xffffffffffffffffui64
-#define UINT64_ERROR    0xffffffffffffffffui64
-
-#ifdef _WIN64
-#define INT_PTR_ERROR   (-1i64)
-#define UINT_PTR_ERROR  0xffffffffffffffffui64
-#define LONG_PTR_ERROR  (-1i64)
-#define ULONG_PTR_ERROR 0xffffffffffffffffui64
-#define DWORD_PTR_ERROR 0xffffffffffffffffui64
-#define PTRDIFF_T_ERROR (-1i64)
-#define SIZE_T_ERROR    0xffffffffffffffffui64
-#define SSIZE_T_ERROR   (-1i64)
-#define _SIZE_T_ERROR   0xffffffffffffffffui64
+#define LONGLONG_ERROR  (-1ll)
+#define LONG64_ERROR    (-1ll)
+#define INT64_ERROR     (-1ll)
+#define ULONGLONG_ERROR 0xffffffffffffffffull
+#define DWORDLONG_ERROR 0xffffffffffffffffull
+#define ULONG64_ERROR   0xffffffffffffffffull
+#define UINT64_ERROR    0xffffffffffffffffull
+
+#ifdef _WIN64
+#define INT_PTR_ERROR   (-1ll)
+#define UINT_PTR_ERROR  0xffffffffffffffffull
+#define LONG_PTR_ERROR  (-1ll)
+#define ULONG_PTR_ERROR 0xffffffffffffffffull
+#define DWORD_PTR_ERROR 0xffffffffffffffffull
+#define PTRDIFF_T_ERROR (-1ll)
+#define SIZE_T_ERROR    0xffffffffffffffffull
+#define SSIZE_T_ERROR   (-1ll)
+#define _SIZE_T_ERROR   0xffffffffffffffffull
 #else
 #define INT_PTR_ERROR   (-1) 
 #define UINT_PTR_ERROR  0xffffffff
@@ -7570,13 +7570,13 @@
 
             // a * d must be less than 2^32 or there would be bits set in the high 64-bits
             ad = (((ULONGLONG)dw_a) * (ULONGLONG)dw_d);
-            if ((ad & 0xffffffff00000000) == 0)
+            if ((ad & 0xffffffff00000000ULL) == 0)
             {
                 dw_b = (DWORD)ullMultiplicand;
 
                 // b * c must be less than 2^32 or there would be bits set in the high 64-bits
                 bc = (((ULONGLONG)dw_b) * (ULONGLONG)dw_c);
-                if ((bc & 0xffffffff00000000) == 0)
+                if ((bc & 0xffffffff00000000ULL) == 0)
                 {
                     // now sum them all up checking for overflow.
                     // shifting is safe because we already checked for overflow above
@@ -8015,10 +8015,14 @@
 // Macros that are no longer used in this header but which clients may
 // depend on being defined here.
 //
-#define LOWORD(_dw)     ((WORD)(((DWORD_PTR)(_dw)) & 0xffff))
-#define HIWORD(_dw)     ((WORD)((((DWORD_PTR)(_dw)) >> 16) & 0xffff))
+//#define LOWORD(_dw)     ((WORD)(((DWORD_PTR)(_dw)) & 0xffff))
+//#define HIWORD(_dw)     ((WORD)((((DWORD_PTR)(_dw)) >> 16) & 0xffff))
 #define LODWORD(_qw)    ((DWORD)(_qw))
 #define HIDWORD(_qw)    ((DWORD)(((_qw) >> 32) & 0xffffffff))
 
+#undef __in
+#undef __out
+#undef __inline
+
 #endif // _INTSAFE_H_INCLUDED_
 
--- include/mapinls.h.orig	2005-04-14 17:54:46.000000000 +0900
+++ include/mapinls.h	2006-12-30 20:46:11.125000000 +0900
@@ -72,7 +72,7 @@
 typedef const void FAR *				LPCVOID;
 
 #ifndef _MAC
-#ifndef LPOLESTR
+#ifndef OLESTR
 #if !defined (_WIN32)
 
 #define LPOLESTR        LPSTR
@@ -88,9 +88,11 @@
 #define OLESTR(str)     L##str
 
 #endif /* !_WIN32 */
-#endif /* LPOLESTR */
+#endif /* OLESTR */
 #endif /* _MAC */
 
+#ifndef NORM_IGNORECASE
+
 #define NORM_IGNORECASE      			0x00000001     /* ignore case */
 #define NORM_IGNORENONSPACE  			0x00000002     /* ignore diacritics */
 #define NORM_IGNORESYMBOLS   			0x00000004     /* ignore symbols */
@@ -103,6 +105,8 @@
 #define NORM_IGNOREKANATYPE				0x00000040		/* ignore kanatype */
 #endif
 
+#endif /* NORM_IGNORECASE */
+
 #if defined(WIN16)
 
 #define	lstrcpyA						lstrcpy
--- include/mapiwin.h.orig	2003-03-26 16:34:38.000000000 +0900
+++ include/mapiwin.h	2004-12-28 21:41:14.000000000 +0900
@@ -428,5 +428,5 @@
 #endif
 
 #endif /* __MAPIWIN_H__ */
-
+
 
--- include/msdasc.h.orig	2005-04-04 18:50:18.000000000 +0900
+++ include/msdasc.h	2007-01-05 21:47:51.515625000 +0900
@@ -1,3 +1,6 @@
+#if __GNUC__ >=3
+#pragma GCC system_header
+#endif
 
 
 /* this ALWAYS GENERATED file contains the definitions for the interfaces */
--- include/multimon.h.orig	2005-04-14 17:54:52.000000000 +0900
+++ include/multimon.h	2006-12-31 18:00:37.203125000 +0900
@@ -175,7 +175,7 @@
 
 BOOL IsPlatformNT()
 { 
-    OSVERSIONINFOA osvi = {0};
+    OSVERSIONINFOA osvi;
     osvi.dwOSVersionInfoSize = sizeof(osvi);
     GetVersionExA((OSVERSIONINFOA*)&osvi);
     return (VER_PLATFORM_WIN32_NT == osvi.dwPlatformId);    
--- include/ntquery.h.orig	2008-01-18 22:17:30.000000000 +0900
+++ include/ntquery.h	2008-03-27 00:04:44.749750000 +0900
@@ -1,3 +1,6 @@
+#if __GNUC__ >=3
+#pragma GCC system_header
+#endif
 //+---------------------------------------------------------------------------
 //
 //  Microsoft Windows
@@ -18,6 +21,14 @@
 
 #include "stgprop.h"
 
+#define __in
+#define __out
+#ifdef __cplusplus
+#define __inline inline
+#else
+#define __inline static
+#endif
+
 #if defined(__cplusplus)
 extern "C"
 {
@@ -404,6 +415,10 @@
 }
 #endif
 
+#undef __in
+#undef __out
+#undef __inline
+
 #endif // __NTQUERY_H__
 
 
--- include/ocidl.h.orig	2008-03-22 06:10:42.272000000 +1000
+++ include/ocidl.h	2008-03-24 02:27:18.132625000 +1000
@@ -1,3 +1,6 @@
+#if __GNUC__ >=3
+#pragma GCC system_header
+#endif
 
 
 /* this ALWAYS GENERATED file contains the definitions for the interfaces */
@@ -294,6 +297,14 @@
 #include "servprov.h"
 #include "urlmon.h"
 
+#define __in
+#define __out
+#ifdef __cplusplus
+#define __inline inline
+#else
+#define __inline static
+#endif
+
 #ifdef __cplusplus
 extern "C"{
 #endif 
@@ -4595,11 +4606,13 @@
 	HITRESULT_HIT	= 3
     } 	HITRESULT;
 
+#if 0
 typedef /* [v1_enum] */ 
 enum tagDVASPECT2
     {	DVASPECT_OPAQUE	= 16,
 	DVASPECT_TRANSPARENT	= 32
     } 	DVASPECT2;
+#endif
 
 typedef struct tagExtentInfo
     {
@@ -6554,6 +6567,10 @@
 }
 #endif
 
+#undef __in
+#undef __out
+#undef __inline
+
 #endif
 
 
--- include/oleauto.h.orig	2008-03-22 06:10:43.225125000 +1000
+++ include/oleauto.h	2008-03-24 02:27:37.304500000 +1000
@@ -56,6 +56,14 @@
 /* pull in the MIDL generated header */
 #include <oaidl.h>
 
+#define __in
+#define __out
+#ifdef __cplusplus
+#define __inline inline
+#else
+#define __inline static
+#endif
+
 
 /*---------------------------------------------------------------------*/
 /*                            BSTR API                                 */
@@ -948,6 +956,9 @@
 /*             ICreateTypeLib                                          */
 /*---------------------------------------------------------------------*/
 
+typedef interface ICreateTypeLib ICreateTypeLib;
+typedef interface ICreateTypeLib2 ICreateTypeLib2;
+typedef interface ICreateTypeInfo ICreateTypeInfo;
 typedef ICreateTypeLib * LPCREATETYPELIB;
 
 typedef ICreateTypeInfo * LPCREATETYPEINFO;
@@ -1160,7 +1171,7 @@
 
 // Declare variant access functions.
 
-#if __STDC__ || defined(NONAMELESSUNION)
+#ifdef NONAMELESSUNION
 #define V_UNION(X, Y)   ((X)->n1.n2.n3.Y)
 #define V_VT(X)         ((X)->n1.n2.vt)
 #define V_RECORDINFO(X) ((X)->n1.n2.n3.brecVal.pRecInfo)
@@ -1242,5 +1253,9 @@
 #include <poppack.h>
 #endif // RC_INVOKED
 
+#undef __in
+#undef __out
+#undef __inline
+
 #endif     // __OLEAUTO_H__
 
--- include/oledb.h.orig	2005-04-04 18:50:18.000000000 +0900
+++ include/oledb.h	2007-01-02 17:16:30.656250000 +0900
@@ -1,3 +1,6 @@
+#if __GNUC__ >=3
+#pragma GCC system_header
+#endif
 
 
 /* this ALWAYS GENERATED file contains the definitions for the interfaces */
@@ -797,7 +800,7 @@
 
 //@@@+ V2.0
 #if( OLEDBVER >= 0x0200 )
-#if !defined(_WINBASE_) && !defined(_FILETIME_)
+#if !defined(_WINBASE_H) && !defined(_FILETIME_)
 #define _FILETIME_
 typedef struct _FILETIME {
 		DWORD dwLowDateTime;
--- include/oleidl.h.orig	2008-03-22 06:10:42.350125000 +1000
+++ include/oleidl.h	2008-03-24 02:27:27.195125000 +1000
@@ -1,3 +1,6 @@
+#if __GNUC__ >=3
+#pragma GCC system_header
+#endif
 
 
 /* this ALWAYS GENERATED file contains the definitions for the interfaces */
@@ -189,6 +192,14 @@
 /* header files for imported files */
 #include "objidl.h"
 
+#define __in
+#define __out
+#ifdef __cplusplus
+#define __inline inline
+#else
+#define __inline static
+#endif
+
 #ifdef __cplusplus
 extern "C"{
 #endif 
@@ -3868,6 +3879,10 @@
 }
 #endif
 
+#undef __in
+#undef __out
+#undef __inline
+
 #endif
 
 
--- include/propidl.h.orig	2008-01-18 22:17:32.000000000 +0900
+++ include/propidl.h	2008-03-27 20:26:16.221125000 +0900
@@ -76,6 +76,14 @@
 #include "objidl.h"
 #include "oaidl.h"
 
+#define __in
+#define __out
+#ifdef __cplusplus
+#define __inline inline
+#else
+#define __inline static
+#endif
+
 #ifdef __cplusplus
 extern "C"{
 #endif 
@@ -285,11 +293,6 @@
 #define tag_inner_PROPVARIANT
 #endif
 
-#if !defined(_MSC_EXTENSIONS)
-
-struct tagPROPVARIANT;
-
-#else
 #ifndef MIDL_PASS
 struct tagPROPVARIANT {
   union {
@@ -316,7 +319,7 @@
         FLOAT fltVal;
         DOUBLE dblVal;
         VARIANT_BOOL boolVal;
-        _VARIANT_BOOL bool;
+//        _VARIANT_BOOL bool;
         SCODE scode;
         CY cyVal;
         DATE date;
@@ -384,8 +387,6 @@
 };
 #endif
 
-#endif /* _MSC_EXTENSIONS */
-
 #ifdef MIDL_PASS
 // This is the LPPROPVARIANT definition for marshaling.
 typedef struct tag_inner_PROPVARIANT *LPPROPVARIANT;
@@ -1268,6 +1269,10 @@
 }
 #endif
 
+#undef __in
+#undef __out
+#undef __inline
+
 #endif
 
 
--- include/propsys.h.orig	2008-03-22 06:10:42.412625000 +1000
+++ include/propsys.h	2008-03-24 02:29:37.085750000 +1000
@@ -228,6 +228,14 @@
 #endif // 0
 #include <propkeydef.h>
 
+#define __in
+#define __out
+#ifdef __cplusplus
+#define __inline inline
+#else
+#define __inline static
+#endif
+
 
 extern RPC_IF_HANDLE __MIDL_itf_propsys_0000_0000_v0_0_c_ifspec;
 extern RPC_IF_HANDLE __MIDL_itf_propsys_0000_0000_v0_0_s_ifspec;
@@ -3600,6 +3608,10 @@
 }
 #endif
 
+#undef __in
+#undef __out
+#undef __inline
+
 #endif
 
 
--- include/qedit.h.orig	2005-04-14 17:54:56.000000000 +0900
+++ include/qedit.h	2007-01-02 22:11:05.140625000 +0900
@@ -1,3 +1,6 @@
+#if __GNUC__ >=3
+#pragma GCC system_header
+#endif
 
 
 /* this ALWAYS GENERATED file contains the definitions for the interfaces */
@@ -6546,10 +6549,10 @@
 #define DEX_IDS_GRAPH_ERROR        1427
 #define DEX_IDS_GRID_ERROR        1428
 #define DEX_IDS_INTERFACE_ERROR    1429
-EXTERN_GUID(CLSID_VideoEffects1Category, 0xcc7bfb42, 0xf175, 0x11d1, 0xa3, 0x92, 0x0, 0xe0, 0x29, 0x1f, 0x39, 0x59);
-EXTERN_GUID(CLSID_VideoEffects2Category, 0xcc7bfb43, 0xf175, 0x11d1, 0xa3, 0x92, 0x0, 0xe0, 0x29, 0x1f, 0x39, 0x59);
-EXTERN_GUID(CLSID_AudioEffects1Category, 0xcc7bfb44, 0xf175, 0x11d1, 0xa3, 0x92, 0x0, 0xe0, 0x29, 0x1f, 0x39, 0x59);
-EXTERN_GUID(CLSID_AudioEffects2Category, 0xcc7bfb45, 0xf175, 0x11d1, 0xa3, 0x92, 0x0, 0xe0, 0x29, 0x1f, 0x39, 0x59);
+DEFINE_GUID(CLSID_VideoEffects1Category, 0xcc7bfb42, 0xf175, 0x11d1, 0xa3, 0x92, 0x0, 0xe0, 0x29, 0x1f, 0x39, 0x59);
+DEFINE_GUID(CLSID_VideoEffects2Category, 0xcc7bfb43, 0xf175, 0x11d1, 0xa3, 0x92, 0x0, 0xe0, 0x29, 0x1f, 0x39, 0x59);
+DEFINE_GUID(CLSID_AudioEffects1Category, 0xcc7bfb44, 0xf175, 0x11d1, 0xa3, 0x92, 0x0, 0xe0, 0x29, 0x1f, 0x39, 0x59);
+DEFINE_GUID(CLSID_AudioEffects2Category, 0xcc7bfb45, 0xf175, 0x11d1, 0xa3, 0x92, 0x0, 0xe0, 0x29, 0x1f, 0x39, 0x59);
 
 
 extern RPC_IF_HANDLE __MIDL_itf_qedit_0001_0097_v0_0_c_ifspec;
--- include/shlobj.h.orig	2008-01-18 22:17:36.000000000 +0900
+++ include/shlobj.h	2008-03-26 23:51:11.765375000 +0900
@@ -1,3 +1,6 @@
+#if __GNUC__ >=3
+#pragma GCC system_header
+#endif
 /*===========================================================================
 
 Copyright (c) Microsoft Corporation. All rights reserved.
@@ -103,6 +106,14 @@
 #include <shtypes.h>
 #include <shobjidl.h>
 
+#define __in
+#define __out
+#ifdef __cplusplus
+#define __inline inline
+#else
+#define __inline static
+#endif
+
 #if defined(_MSC_VER) && (_MSC_VER >= 1200)
 #pragma once
 #endif
@@ -250,9 +261,10 @@
 #define GIL_FORCENOSHIELD 0x0400      // icon must *not* be "stamped" with the LUA shield
 
 #undef  INTERFACE
+EXTERN_C const IID IID_IExtractIconA;
 #define INTERFACE   IExtractIconA
 
-DECLARE_INTERFACE_IID_(IExtractIconA, IUnknown, "000214eb-0000-0000-c000-000000000046")
+DECLARE_INTERFACE_(IExtractIconA, IUnknown)
 {
     // *** IUnknown methods ***
     STDMETHOD(QueryInterface) (THIS_ REFIID riid, __out void **ppv) PURE;
@@ -278,9 +290,10 @@
 typedef IExtractIconA * LPEXTRACTICONA;
 
 #undef  INTERFACE
+EXTERN_C const IID IID_IExtractIconW;
 #define INTERFACE   IExtractIconW
 
-DECLARE_INTERFACE_IID_(IExtractIconW, IUnknown, "000214fa-0000-0000-c000-000000000046")
+DECLARE_INTERFACE_(IExtractIconW, IUnknown)
 {
     // *** IUnknown methods ***
     STDMETHOD(QueryInterface) (THIS_ REFIID riid, __out void **ppv) PURE;
@@ -350,9 +363,10 @@
 //===========================================================================
 
 #undef  INTERFACE
+EXTERN_C const IID IID_IShellIconOverlayIdentifier;
 #define INTERFACE   IShellIconOverlayIdentifier
 
-DECLARE_INTERFACE_IID_(IShellIconOverlayIdentifier, IUnknown, "0c6c4200-c589-11d0-999a-00c04fd655e1")
+DECLARE_INTERFACE_(IShellIconOverlayIdentifier, IUnknown)
 {
     // *** IUnknown methods ***
     STDMETHOD(QueryInterface) (THIS_ REFIID riid, __out void **ppv) PURE;
@@ -399,9 +413,10 @@
 //===========================================================================
 
 #undef  INTERFACE
+EXTERN_C const IID IID_IShellIconOverlayManager;
 #define INTERFACE   IShellIconOverlayManager
 
-DECLARE_INTERFACE_IID_(IShellIconOverlayManager, IUnknown, "f10b5e34-dd3b-42a7-aa7d-2f4ec54bb09b")
+DECLARE_INTERFACE_(IShellIconOverlayManager, IUnknown)
 {
     // *** IUnknown methods ***
     STDMETHOD(QueryInterface) (THIS_ REFIID riid, __out void **ppv) PURE;
@@ -447,9 +462,10 @@
 //===========================================================================
 
 #undef  INTERFACE
+EXTERN_C const IID IID_IShellIconOverlay;
 #define INTERFACE   IShellIconOverlay
 
-DECLARE_INTERFACE_IID_(IShellIconOverlay, IUnknown, "7d688a70-c613-11d0-999b-00c04fd655e1")
+DECLARE_INTERFACE_(IShellIconOverlay, IUnknown)
 {
     // *** IUnknown methods ***
     STDMETHOD(QueryInterface) (THIS_ REFIID riid, __out void **ppv) PURE;
@@ -636,9 +652,10 @@
 //===========================================================================
 
 #undef  INTERFACE
+EXTERN_C const IID IID_IShellExecuteHookA;
 #define INTERFACE   IShellExecuteHookA
 
-DECLARE_INTERFACE_IID_(IShellExecuteHookA, IUnknown, "000214f5-0000-0000-c000-000000000046")
+DECLARE_INTERFACE_(IShellExecuteHookA, IUnknown)
 {
     // *** IUnknown methods ***
     STDMETHOD(QueryInterface) (THIS_ REFIID riid, __out void **ppv) PURE;
@@ -650,9 +667,10 @@
 };
 
 #undef  INTERFACE
+EXTERN_C const IID IID_IShellExecuteHookW;
 #define INTERFACE   IShellExecuteHookW
 
-DECLARE_INTERFACE_IID_(IShellExecuteHookW, IUnknown, "000214fb-0000-0000-c000-000000000046")
+DECLARE_INTERFACE_(IShellExecuteHookW, IUnknown)
 {
     // *** IUnknown methods ***
     STDMETHOD(QueryInterface) (THIS_ REFIID riid, __out void **ppv) PURE;
@@ -679,9 +697,10 @@
 //===========================================================================
 
 #undef  INTERFACE
+EXTERN_C const IID IID_IURLSearchHook;
 #define INTERFACE   IURLSearchHook
 
-DECLARE_INTERFACE_IID_(IURLSearchHook, IUnknown, "ac60f6a0-0fd9-11d0-99cb-00c04fd64497")
+DECLARE_INTERFACE_(IURLSearchHook, IUnknown)
 {
     // *** IUnknown methods ***
     STDMETHOD(QueryInterface) (THIS_ REFIID riid, __out void **ppv) PURE;
@@ -693,9 +712,10 @@
 };
 
 #undef  INTERFACE
+EXTERN_C const IID IID_ISearchContext;
 #define INTERFACE   ISearchContext
 
-DECLARE_INTERFACE_IID_(ISearchContext, IUnknown, "09F656A2-41AF-480C-88F7-16CC0D164615")
+DECLARE_INTERFACE_(ISearchContext, IUnknown)
 {
     // *** IUnknown methods ***
     STDMETHOD(QueryInterface) (THIS_ REFIID riid, __out void **ppv) PURE;
@@ -709,9 +729,10 @@
 };
 
 #undef  INTERFACE
+EXTERN_C const IID IID_IURLSearchHook2;
 #define INTERFACE   IURLSearchHook2
 
-DECLARE_INTERFACE_IID_(IURLSearchHook2, IURLSearchHook, "5ee44da4-6d32-46e3-86bc-07540dedd0e0")
+DECLARE_INTERFACE_(IURLSearchHook2, IURLSearchHook)
 {
     // *** IURLSearchHook2 methods ***
     STDMETHOD(TranslateWithSearchContext)(THIS_ __out_ecount(cchBufferSize) LPWSTR lpwszSearchURL, DWORD cchBufferSize, __in_opt ISearchContext * pSearchContext) PURE;
@@ -724,9 +745,10 @@
 //===========================================================================
 
 #undef  INTERFACE
+EXTERN_C const IID IID_INewShortcutHookA;
 #define INTERFACE   INewShortcutHookA
 
-DECLARE_INTERFACE_IID_(INewShortcutHookA, IUnknown, "000214e1-0000-0000-c000-000000000046")
+DECLARE_INTERFACE_(INewShortcutHookA, IUnknown)
 {
     // *** IUnknown methods ***
     STDMETHOD(QueryInterface) (THIS_ REFIID riid, __out void **ppv) PURE;
@@ -743,9 +765,10 @@
 };
 
 #undef  INTERFACE
+EXTERN_C const IID IID_INewShortcutHookW;
 #define INTERFACE   INewShortcutHookW
 
-DECLARE_INTERFACE_IID_(INewShortcutHookW, IUnknown, "000214f7-0000-0000-c000-000000000046")
+DECLARE_INTERFACE_(INewShortcutHookW, IUnknown)
 {
     // *** IUnknown methods ***
     STDMETHOD(QueryInterface) (THIS_ REFIID riid, __out void **ppv) PURE;
@@ -800,9 +823,10 @@
 //===========================================================================
 
 #undef  INTERFACE
+EXTERN_C const IID IID_ICopyHookA;
 #define INTERFACE   ICopyHookA
 
-DECLARE_INTERFACE_IID_(ICopyHookA, IUnknown, "000214EF-0000-0000-c000-000000000046")
+DECLARE_INTERFACE_(ICopyHookA, IUnknown)
 {
     // *** IUnknown methods ***
     STDMETHOD(QueryInterface) (THIS_ REFIID riid, __out void **ppv) PURE;
@@ -817,9 +841,10 @@
 typedef ICopyHookA *    LPCOPYHOOKA;
 
 #undef  INTERFACE
+EXTERN_C const IID IID_ICopyHookW;
 #define INTERFACE   ICopyHookW
 
-DECLARE_INTERFACE_IID_(ICopyHookW, IUnknown, "000214FC-0000-0000-c000-000000000046")
+DECLARE_INTERFACE_(ICopyHookW, IUnknown)
 {
     // *** IUnknown methods ***
     STDMETHOD(QueryInterface) (THIS_ REFIID riid, __out void **ppv) PURE;
@@ -853,9 +878,10 @@
 //===========================================================================
 
 #undef  INTERFACE
+EXTERN_C const IID IID_IFileViewerSite;
 #define INTERFACE   IFileViewerSite
 
-DECLARE_INTERFACE_IID_(IFileViewerSite, IUnknown, "000214f3-0000-0000-c000-000000000046")
+DECLARE_INTERFACE_(IFileViewerSite, IUnknown)
 {
     // *** IUnknown methods ***
     STDMETHOD(QueryInterface) (THIS_ REFIID riid, __out void **ppv) PURE;
@@ -912,9 +938,10 @@
 #define FVSIF_CANVIEWIT 0x40000000      // The viewer can view it.
 
 #undef  INTERFACE
+EXTERN_C const IID IID_IFileViewerA;
 #define INTERFACE   IFileViewerA
 
-DECLARE_INTERFACE_IID(IFileViewerA, "000214f0-0000-0000-c000-000000000046")
+DECLARE_INTERFACE(IFileViewerA)
 {
     // *** IUnknown methods ***
     STDMETHOD(QueryInterface) (THIS_ REFIID riid, __out void **ppv) PURE;
@@ -930,9 +957,10 @@
 typedef IFileViewerA * LPFILEVIEWERA;
 
 #undef  INTERFACE
+EXTERN_C const IID IID_IFileViewerW;
 #define INTERFACE   IFileViewerW
 
-DECLARE_INTERFACE_IID(IFileViewerW, "000214f8-0000-0000-c000-000000000046")
+DECLARE_INTERFACE(IFileViewerW)
 {
     // *** IUnknown methods ***
     STDMETHOD(QueryInterface) (THIS_ REFIID riid, __out void **ppv) PURE;
@@ -1484,9 +1512,10 @@
 // implement IShellFolder2::GetDetailsOf()/GetDetailsEx() instead
 
 #undef  INTERFACE
+EXTERN_C const IID IID_IShellDetails;
 #define INTERFACE   IShellDetails
 
-DECLARE_INTERFACE_IID_(IShellDetails, IUnknown, "000214EC-0000-0000-c000-000000000046")
+DECLARE_INTERFACE_(IShellDetails, IUnknown)
 {
     // *** IUnknown methods ***
     STDMETHOD(QueryInterface) (THIS_ REFIID riid, __out void **ppv) PURE;
@@ -1513,9 +1542,10 @@
 //
 
 #undef INTERFACE
+EXTERN_C const IID IID_IObjMgr;
 #define INTERFACE IObjMgr
 
-DECLARE_INTERFACE_IID_(IObjMgr, IUnknown, "00BB2761-6A77-11D0-A535-00C04FD7D062")
+DECLARE_INTERFACE_(IObjMgr, IUnknown)
 {
     // *** IUnknown methods ***
     STDMETHOD(QueryInterface) (THIS_ REFIID riid, __out void **ppv) PURE;
@@ -1547,9 +1577,10 @@
 //
 
 #undef INTERFACE
+EXTERN_C const IID IID_ICurrentWorkingDirectory;
 #define INTERFACE ICurrentWorkingDirectory
 
-DECLARE_INTERFACE_IID_(ICurrentWorkingDirectory, IUnknown, "91956D21-9276-11d1-921A-006097DF5BD4")
+DECLARE_INTERFACE_(ICurrentWorkingDirectory, IUnknown)
 {
     // *** IUnknown methods ***
     STDMETHOD(QueryInterface) (THIS_ REFIID riid, __out void **ppv) PURE;
@@ -1578,9 +1609,10 @@
 //
 
 #undef INTERFACE
+EXTERN_C const IID IID_IACList;
 #define INTERFACE IACList
 
-DECLARE_INTERFACE_IID_(IACList, IUnknown, "77A130B0-94FD-11D0-A544-00C04FD7d062")
+DECLARE_INTERFACE_(IACList, IUnknown)
 {
     // *** IUnknown methods ***
     STDMETHOD(QueryInterface) (THIS_ REFIID riid, __out void **ppv) PURE;
@@ -1597,6 +1629,7 @@
 // List COM object that implements this interface.
 
 #undef INTERFACE
+EXTERN_C const IID IID_IACList2;
 #define INTERFACE IACList2
 
 typedef enum _tagAUTOCOMPLETELISTOPTIONS
@@ -1615,7 +1648,7 @@
 #endif
 } AUTOCOMPLETELISTOPTIONS;
 
-DECLARE_INTERFACE_IID_(IACList2, IACList, "470141a0-5186-11d2-bbb6-0060977b464c")
+DECLARE_INTERFACE_(IACList2, IACList)
 {
     // *** IACList2 specific methods ***
     STDMETHOD(SetOptions)(THIS_ DWORD dwFlag) PURE;
@@ -1692,9 +1725,10 @@
 
 
 #undef  INTERFACE
+EXTERN_C const IID IID_IProgressDialog;
 #define INTERFACE   IProgressDialog
 
-DECLARE_INTERFACE_IID_(IProgressDialog, IUnknown, "EBBC7C04-315E-11d2-B62F-006097DF5BD4")
+DECLARE_INTERFACE_(IProgressDialog, IUnknown)
 {
     // *** IUnknown methods ***
     STDMETHOD(QueryInterface) (THIS_ REFIID riid, __out void **ppv) PURE;
@@ -1751,9 +1785,10 @@
 
 
 #undef  INTERFACE
+EXTERN_C const IID IID_IDockingWindowSite;
 #define INTERFACE   IDockingWindowSite
 
-DECLARE_INTERFACE_IID_(IDockingWindowSite, IOleWindow, "2a342fc2-7b26-11d0-8ca9-00a0c92dbfe8")
+DECLARE_INTERFACE_(IDockingWindowSite, IOleWindow)
 {
     // *** IUnknown methods ***
     STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
@@ -1800,9 +1835,10 @@
 
 
 #undef  INTERFACE
+EXTERN_C const IID IID_IDockingWindowFrame;
 #define INTERFACE   IDockingWindowFrame
 
-DECLARE_INTERFACE_IID_(IDockingWindowFrame, IOleWindow, "47d2657a-7b27-11d0-8ca9-00a0c92dbfe8")
+DECLARE_INTERFACE_(IDockingWindowFrame, IOleWindow)
 {
     // *** IUnknown methods ***
     STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
@@ -1829,9 +1865,10 @@
  */
 
 #undef  INTERFACE
+EXTERN_C const IID IID_IThumbnailCapture;
 #define INTERFACE   IThumbnailCapture
 
-DECLARE_INTERFACE_IID_(IThumbnailCapture, IUnknown, "4ea39266-7211-409f-b622-f63dbd16c533")
+DECLARE_INTERFACE_(IThumbnailCapture, IUnknown)
 {
     // *** IThumbnailCapture methods ***
     STDMETHOD (CaptureThumbnail)    ( THIS_ const SIZE * pMaxSize,
@@ -1856,9 +1893,10 @@
 #include <poppack.h>        /* Return to byte packing */
 
 #undef  INTERFACE
+EXTERN_C const IID IID_IEnumShellImageStore;
 #define INTERFACE   IEnumShellImageStore
 
-DECLARE_INTERFACE_IID_( IEnumShellImageStore, IUnknown, "6DFD582B-92E3-11D1-98A3-00C04FB687DA" )
+DECLARE_INTERFACE_( IEnumShellImageStore, IUnknown)
 {
     STDMETHOD ( QueryInterface ) ( THIS_ REFIID riid, void **ppv ) PURE;
     STDMETHOD_( ULONG, AddRef ) ( THIS ) PURE;
@@ -1878,11 +1916,12 @@
 #define SHIMSTCAPFLAG_PURGEABLE   0x0002       // does the store require dead items purging externally ?
 
 #undef  INTERFACE
+EXTERN_C const IID IID_IShellImageStore;
 #define INTERFACE   IShellImageStore
 
 // this interface is used to manipulate the Image cache. It can potentially be used
 // in a free threaded manner in conjunction with the Lock parameter to Open and close
-DECLARE_INTERFACE_IID_( IShellImageStore, IUnknown, "48C8118C-B924-11D1-98D5-00C04FB687DA" )
+DECLARE_INTERFACE_( IShellImageStore, IUnknown)
 {
     STDMETHOD ( QueryInterface )( THIS_ REFIID riid, void **ppv ) PURE;
     STDMETHOD_( ULONG, AddRef ) ( THIS ) PURE;
@@ -1961,9 +2000,10 @@
 #include <poppack.h>        /* Return to byte packing */
 
 #undef INTERFACE
+EXTERN_C const IID IID_IShellFolderBand;
 #define INTERFACE IShellFolderBand
 
-DECLARE_INTERFACE_IID_(IShellFolderBand, IUnknown, "7FE80CC8-C247-11d0-B93A-00A0C90312E1")
+DECLARE_INTERFACE_(IShellFolderBand, IUnknown)
 {
     // *** IUnknown methods ***
     STDMETHOD(QueryInterface) (THIS_ REFIID riid, __out void **ppv) PURE;
@@ -1984,9 +2024,10 @@
 ////  IDeskBarClient
 
 #undef  INTERFACE
+EXTERN_C const IID IID_IDeskBarClient;
 #define INTERFACE   IDeskBarClient
 
-DECLARE_INTERFACE_IID_(IDeskBarClient, IOleWindow, "EB0FE175-1A3A-11D0-89B3-00A0C90A90AC")
+DECLARE_INTERFACE_(IDeskBarClient, IOleWindow)
 {
     // *** IUnknown methods ***
     STDMETHOD(QueryInterface) (THIS_ REFIID riid, __out void **ppv) PURE;
@@ -2238,9 +2279,10 @@
 //
 
 #undef INTERFACE
+EXTERN_C const IID IID_IActiveDesktop;
 #define INTERFACE IActiveDesktop
 
-DECLARE_INTERFACE_IID_(IActiveDesktop, IUnknown, "f490eb00-1240-11d1-9888-006097deacf9")
+DECLARE_INTERFACE_(IActiveDesktop, IUnknown)
 {
     // IUnknown methods
     STDMETHOD (QueryInterface)(THIS_ REFIID riid, __out void **ppv) PURE;
@@ -2288,9 +2330,10 @@
 #define SCHEME_CREATE           0x0080
 
 #undef INTERFACE
+EXTERN_C const IID IID_IActiveDesktopP;
 #define INTERFACE IActiveDesktopP
 
-DECLARE_INTERFACE_IID_(IActiveDesktopP, IUnknown, "52502EE0-EC80-11D0-89AB-00C04FC2972D")
+DECLARE_INTERFACE_(IActiveDesktopP, IUnknown)
 {
     // IUnknown methods
     STDMETHOD (QueryInterface)(THIS_ REFIID riid, __out void **ppv) PURE;
@@ -2311,9 +2354,10 @@
 #define GADOF_DIRTY    0x00000001
 
 #undef INTERFACE
+EXTERN_C const IID IID_IADesktopP2;
 #define INTERFACE IADesktopP2
 
-DECLARE_INTERFACE_IID_(IADesktopP2, IUnknown, "B22754E2-4574-11d1-9888-006097DEACF9")
+DECLARE_INTERFACE_(IADesktopP2, IUnknown)
 {
     // IUnknown methods
     STDMETHOD (QueryInterface)(THIS_ REFIID riid, __out void **ppv) PURE;
@@ -2375,11 +2419,12 @@
 #include <poppack.h>        /* Return to byte packing */
 
 #undef INTERFACE
+EXTERN_C const IID IID_IColumnProvider;
 #define INTERFACE IColumnProvider
 
 // Note: these objects must be threadsafe!  GetItemData _will_ be called
 // simultaneously from multiple threads.
-DECLARE_INTERFACE_IID_(IColumnProvider, IUnknown, "E8025004-1C42-11d2-BE2C-00A0C9A83DA1")
+DECLARE_INTERFACE_(IColumnProvider, IUnknown)
 {
     // IUnknown methods
     STDMETHOD (QueryInterface)(THIS_ REFIID riid, __out void **ppv) PURE;
@@ -2698,9 +2743,10 @@
 // IShellChangeNotify
 //
 #undef  INTERFACE
+EXTERN_C const IID IID_IShellChangeNotify;
 #define INTERFACE  IShellChangeNotify
 
-DECLARE_INTERFACE_IID_(IShellChangeNotify, IUnknown, "D82BE2B1-5764-11D0-A96E-00C04FD705A2")
+DECLARE_INTERFACE_(IShellChangeNotify, IUnknown)
 {
     // *** IUnknown methods ***
     STDMETHOD(QueryInterface) (THIS_ REFIID riid, __out void **ppv) PURE;
@@ -2723,9 +2769,10 @@
 //-------------------------------------------------------------------------
 
 #undef  INTERFACE
+EXTERN_C const IID IID_IQueryInfo;
 #define INTERFACE  IQueryInfo
 
-DECLARE_INTERFACE_IID_(IQueryInfo, IUnknown, "00021500-0000-0000-c000-000000000046")
+DECLARE_INTERFACE_(IQueryInfo, IUnknown)
 {
     // *** IUnknown methods ***
     STDMETHOD(QueryInterface) (THIS_ REFIID riid, __out void **ppv) PURE;
@@ -3117,7 +3164,7 @@
 SHSTDAPI_(BOOL)                 ILIsEqual(__in PCIDLIST_ABSOLUTE pidl1, __in PCIDLIST_ABSOLUTE pidl2);
 SHSTDAPI_(BOOL)                 ILIsParent(__in PCIDLIST_ABSOLUTE pidl1, __in PCIDLIST_ABSOLUTE pidl2, BOOL fImmediate);
 SHSTDAPI                        ILSaveToStream(__in IStream *pstm, __in PCUIDLIST_RELATIVE pidl);
-DECLSPEC_DEPRECATED SHSTDAPI    ILLoadFromStream(__in IStream *pstm, __inout PIDLIST_RELATIVE *pidl);
+//SHSTDAPI    ILLoadFromStream(__in IStream *pstm, __inout PIDLIST_RELATIVE *pidl);
 SHSTDAPI                        ILLoadFromStreamEx(__in IStream *pstm, __deref_out PIDLIST_RELATIVE *pidl);
 
 #if (_WIN32_IE >= 0x0400)
@@ -3188,8 +3235,9 @@
 
 #if (NTDDI_VERSION >= NTDDI_WIN2K && NTDDI_VERSION < NTDDI_VISTA)
 #undef  INTERFACE
+EXTERN_C const IID IID_IDefViewFrame;
 #define INTERFACE   IDefViewFrame
-DECLARE_INTERFACE_IID_(IDefViewFrame, IUnknown, "710EB7A0-45ED-11D0-924A-0020AFC7AC4D")
+DECLARE_INTERFACE_(IDefViewFrame, IUnknown)
 {
     // *** IUnknown methods ***
     STDMETHOD(QueryInterface) (THIS_ REFIID riid, __out void **ppv) PURE;
@@ -3522,8 +3570,9 @@
 // IDocViewSite
 //
 #undef  INTERFACE
+EXTERN_C const IID IID_IDocViewSite;
 #define INTERFACE  IDocViewSite
-DECLARE_INTERFACE_IID_(IDocViewSite, IUnknown, "87D605E0-C511-11CF-89A9-00A0C9054129")
+DECLARE_INTERFACE_(IDocViewSite, IUnknown)
 {
     // *** IUnknown methods ***
     STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **ppv) PURE;
@@ -3588,9 +3637,10 @@
 SHSTDAPI_(BOOL) IsUserAnAdmin(void);
 
 #undef  INTERFACE
+EXTERN_C const IID IID_IInitializeObject;
 #define INTERFACE   IInitializeObject
 
-DECLARE_INTERFACE_IID_(IInitializeObject, IUnknown, "4622AD16-FF23-11d0-8D34-00A0C90F2719")
+DECLARE_INTERFACE_(IInitializeObject, IUnknown)
 {
     // *** IUnknown methods ***
     STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
@@ -3609,9 +3659,10 @@
 };
 
 #undef  INTERFACE
+EXTERN_C const IID IID_IBanneredBar;
 #define INTERFACE   IBanneredBar
 
-DECLARE_INTERFACE_IID_(IBanneredBar, IUnknown, "596A9A94-013E-11d1-8D34-00A0C90F2719")
+DECLARE_INTERFACE_(IBanneredBar, IUnknown)
 {
     // *** IUnknown methods ***
     STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
@@ -3633,9 +3684,10 @@
 
 //
 #undef  INTERFACE
+EXTERN_C const IID IID_IShellFolderViewCB;
 #define INTERFACE   IShellFolderViewCB
 
-DECLARE_INTERFACE_IID_(IShellFolderViewCB, IUnknown, "2047E320-F2A9-11CE-AE65-08002B2E1262")
+DECLARE_INTERFACE_(IShellFolderViewCB, IUnknown)
 {
     // *** IUnknown methods ***
     STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
@@ -3774,9 +3826,10 @@
 #define SFVS_SELECT_INVERT      0x2 // Inver the selection
 
 #undef  INTERFACE
+EXTERN_C const IID IID_IShellFolderView;
 #define INTERFACE   IShellFolderView
 
-DECLARE_INTERFACE_IID_(IShellFolderView, IUnknown, "37A378C0-F82D-11CE-AE65-08002B2E1262")
+DECLARE_INTERFACE_(IShellFolderView, IUnknown)
 {
     // *** IUnknown methods ***
     STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
@@ -4358,8 +4411,9 @@
 //
 //--------------------------------------------------------------------------
 #undef  INTERFACE
+EXTERN_C const IID IID_INamedPropertyBag;
 #define INTERFACE  INamedPropertyBag
-DECLARE_INTERFACE_IID_(INamedPropertyBag, IUnknown, "FB700430-952C-11d1-946F-000000000000")
+DECLARE_INTERFACE_(INamedPropertyBag, IUnknown)
 {
     // *** IUnknown methods ***
     STDMETHOD(QueryInterface)   (THIS_ REFIID riid, void **ppv) PURE;
@@ -4578,5 +4632,9 @@
 #endif
 #endif
 
+#undef __in
+#undef __out
+#undef __inline
+
 #endif /* _SHLOBJ_H_ */
 
--- include/shobjidl.h.orig	2008-01-18 22:17:36.000000000 +0900
+++ include/shobjidl.h	2008-03-26 23:40:50.202875000 +0900
@@ -1,3 +1,6 @@
+#if __GNUC__ >=3
+#pragma GCC system_header
+#endif
 
 
 /* this ALWAYS GENERATED file contains the definitions for the interfaces */
@@ -1667,6 +1670,14 @@
 #include "prsht.h"
 #include "propsys.h"
 
+#define __in
+#define __out
+#ifdef __cplusplus
+#define __inline inline
+#else
+#define __inline static
+#endif
+
 #ifdef __cplusplus
 extern "C"{
 #endif 
@@ -6384,7 +6395,6 @@
 
 typedef ICommDlgBrowser2 *LPCOMMDLGBROWSER2;
 
-#endif  // NTDDI_WIN2K
 #if (_WIN32_IE >= _WIN32_IE_IE70)
 
 
@@ -6727,6 +6737,7 @@
 /* [local] */ 
 
 #endif  // (_WIN32_IE >= _WIN32_IE_IE70)
+#endif  // NTDDI_WIN2K
 
 
 extern RPC_IF_HANDLE __MIDL_itf_shobjidl_0000_0026_v0_0_c_ifspec;
@@ -7323,6 +7334,7 @@
 #define FCT_MERGE       0x0001
 #define FCT_CONFIGABLE  0x0002
 #define FCT_ADDTOEND    0x0004
+
 #ifdef _NEVER_
 typedef LPARAM LPTBBUTTONSB;
 
@@ -7331,6 +7343,13 @@
 typedef LPTBBUTTON LPTBBUTTONSB;
 #endif //_NEVER_
 
+#define __in
+#define __out
+#ifdef __cplusplus
+#define __inline inline
+#else
+#define __inline static
+#endif
 
 extern RPC_IF_HANDLE __MIDL_itf_shobjidl_0000_0032_v0_0_c_ifspec;
 extern RPC_IF_HANDLE __MIDL_itf_shobjidl_0000_0032_v0_0_s_ifspec;
@@ -29000,6 +29019,10 @@
 }
 #endif
 
+#undef __in
+#undef __out
+#undef __inline
+
 #endif
 
 
--- include/shtypes.h.orig	2006-12-30 18:12:26.093750000 +0900
+++ include/shtypes.h	2006-12-30 18:24:10.953125000 +0900
@@ -1,3 +1,6 @@
+#if __GNUC__ >=3
+#pragma GCC system_header
+#endif
 
 
 /* this ALWAYS GENERATED file contains the definitions for the interfaces */
@@ -137,7 +140,7 @@
 
 #endif // defined(STRICT_TYPED_ITEMIDS) && defined(__cplusplus)
 #include <poppack.h>
-typedef /* [unique] */  __RPC_unique_pointer BYTE_BLOB *wirePIDL;
+//typedef /* [unique] */  __RPC_unique_pointer BYTE_BLOB *wirePIDL;
 
 typedef /* [wire_marshal] */ ITEMIDLIST __unaligned *LPITEMIDLIST;
 
--- include/specstrings.h.orig	2008-01-18 22:17:38.000000000 +0900
+++ include/specstrings.h	2008-03-26 22:08:28.484125000 +0900
@@ -6,7 +6,106 @@
 #if _MSC_VER
 #pragma once
 #endif
-#include <sal.h>  
+//#include <sal.h>  
+#define __RPC__deref_in_ecount_full_opt(x)
+#define __RPC__deref_inout_opt
+#define __RPC__deref_opt_inout_opt
+#define __RPC__deref_opt_inout_ecount_full_opt(x)
+#define __RPC__deref_out
+#define __RPC__deref_out_ecount_full_opt(x)
+#define __RPC__deref_out_opt
+#define __RPC__deref_out_opt_string
+#define __RPC__in
+#define __RPC__in_ecount_full(x)
+#define __RPC__in_ecount_full_opt(x)
+#define __RPC__in_opt
+#define __RPC__inout
+#define __RPC__inout_ecount_full(x)
+#define __RPC__inout_ecount_full_opt(x)
+#define __RPC__inout_opt
+#define __RPC__out
+#define __RPC__out_ecount_full(x)
+#define __RPC__out_ecount_full_string(x)
+#define __RPC__out_ecount_part(x,y)
+#define __RPC_unique_pointer
+#define __callback
+#define __inner_checkReturn
+#define __inner_control_entrypoint(x)
+#define __control_entrypoint(x)
+#define __data_entrypoint(x)
+#define __deref
+#define __deref_inout
+#define __deref_inout_ecount_z(x)
+#define __deref_inout_opt
+#define __deref_opt_inout_bcount_part_opt(x,y)
+#define __deref_opt_inout_opt
+#define __deref_opt_out
+#define __deref_opt_out_bcount(x)
+#define __deref_opt_out_ecount(x)
+#define __deref_opt_out_opt
+#define __deref_out
+#define __deref_out_bcount(x)
+#define __deref_out_bcount_opt(x)
+#define __deref_out_ecount(x)
+#define __deref_out_ecount_opt(x)
+#define __deref_out_ecount_part(x,y)
+#define __deref_out_opt
+#define __deref_out_z
+#define __deref_out_z_opt
+#define __format_string
+#define __in
+#define __in_bcount(x)
+#define __in_bcount_opt(x)
+#define __in_ecount(x)
+#define __in_ecount_opt(x)
+#define __in_opt
+#define __in_z
+#define __in_z_opt
+#define __inout
+#define __inout_bcount(x)
+#define __inout_bcount_full(x)
+#define __inout_bcount_opt(x)
+#define __inout_bcount_part(x,y)
+#define __inout_bcount_part_opt(x,y)
+#define __inout_ecount(x)
+#define __inout_ecount_opt(x)
+#define __inout_opt
+#define __nullnullterminated
+#define __nullterminated
+#define __out
+#define __out_bcount(x)
+#define __out_bcount_full(x)
+#define __out_bcount_opt(x)
+#define __out_bcount_part(x,y)
+#define __out_bcount_part_opt(x,y)
+#define __out_ecount(x)
+#define __out_ecount_full(x)
+#define __out_ecount_opt(x)
+#define __out_ecount_part(x,y)
+#define __out_ecount_part_opt(x,y)
+#define __out_opt
+#define __out_xcount(x)
+#define __out_xcount_opt(x)
+#define __reserved
+#define __success(x)
+#define __typefix(x)
+#define __post
+#define __deref
+#define __pre
+#define __exceptthat
+#define __notnull
+#define __maybenull
+#define __byte_writableTo(x)
+#define __valid
+#define __refparam
+#define __elem_writableTo(x)
+#ifdef __cplusplus
+#define __forceinline inline
+#define __inline inline
+#else
+#define __forceinline static
+#define __inline static
+#endif
 
 #ifndef __SAL_H_FULL_VER
 #define __SAL_H_FULL_VER 140050727
--- include/sspi.h.orig	2008-03-22 06:10:42.631375000 +1000
+++ include/sspi.h	2008-03-24 23:27:32.546000000 +1000
@@ -20,6 +20,14 @@
 #define __SSPI_H__
 // end_ntifs
 
+#define __in
+#define __out
+#ifdef __cplusplus
+#define __inline inline
+#else
+#define __inline static
+#endif
+
 #if _MSC_VER > 1000
 #pragma once
 #endif
@@ -2154,6 +2162,7 @@
 
 // begin_ntifs
 
+#if 0
 #ifndef _AUTH_IDENTITY_DEFINED
 #define _AUTH_IDENTITY_DEFINED
 
@@ -2204,6 +2213,7 @@
 // begin_ntifs
 
 #endif //_AUTH_IDENTITY_DEFINED                                 // ntifs
+#endif
 
 //
 // This is the combined authentication identity structure that may be
@@ -2326,6 +2336,10 @@
 }  // extern "C"
 #endif
 
+#undef __in
+#undef __out
+#undef __inline
+
 // begin_ntifs
 #endif // __SSPI_H__
 // end_ntifs
--- include/strmif.h.orig	2008-01-18 22:17:38.000000000 +0900
+++ include/strmif.h	2008-03-26 22:01:05.171625000 +0900
@@ -1,3 +1,6 @@
+#if __GNUC__ >=3
+#pragma GCC system_header
+#endif
 
 
 /* this ALWAYS GENERATED file contains the definitions for the interfaces */
@@ -888,6 +891,14 @@
 #include "oaidl.h"
 #include "ocidl.h"
 
+#define __in
+#define __out
+#ifdef __cplusplus
+#define __inline inline
+#else
+#define __inline static
+#endif
+
 #ifdef __cplusplus
 extern "C"{
 #endif 
@@ -16250,7 +16261,7 @@
 #define _IAMFilterGraphCallback_
 // Note: Because this interface was not defined as a proper interface it is
 //       supported under C++ only. Methods aren't stdcall.
-EXTERN_GUID(IID_IAMFilterGraphCallback,0x56a868fd,0x0ad4,0x11ce,0xb0,0xa3,0x0,0x20,0xaf,0x0b,0xa7,0x70);
+DEFINE_GUID(IID_IAMFilterGraphCallback,0x56a868fd,0x0ad4,0x11ce,0xb0,0xa3,0x0,0x20,0xaf,0x0b,0xa7,0x70);
 interface IAMFilterGraphCallback : public IUnknown
 {
     // S_OK means rendering complete, S_FALSE means retry now.
@@ -21934,7 +21945,7 @@
 typedef struct tagVMRGUID
     {
     GUID *pGUID;
-    GUID GUID;
+    GUID aGUID;
     } 	VMRGUID;
 
 typedef struct tagVMRMONITORINFO
@@ -23341,6 +23352,10 @@
 }
 #endif
 
+#undef __in
+#undef __out
+#undef __inline
+
 #endif
 
 
--- include/strsafe.h.orig	2008-01-18 22:17:38.000000000 +0900
+++ include/strsafe.h	2008-03-25 23:53:50.406125000 +0900
@@ -13,12 +13,23 @@
 #if (_MSC_VER > 1000)
 #pragma once
 #endif
+#if __GNUC__ >=3
+#pragma GCC system_header
+#endif
 
 #include <stdio.h>          // for _vsnprintf, _vsnwprintf, getc, getwc
 #include <string.h>         // for memset
 #include <stdarg.h>         // for va_start, etc.
 #include <specstrings.h>    // for __in, etc.
 
+#define __in
+#define __out
+#ifdef __cplusplus
+#define __inline inline
+#else
+#define __inline static
+#endif
+
 #if !defined(_W64)
 #if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && (_MSC_VER >= 1300)
 #define _W64 __w64
@@ -9254,7 +9265,7 @@
             wchar_t ch = getwc(stdin);
             // ASSERT(sizeof(wchar_t) == sizeof(wint_t));
             
-            if (ch == WEOF)
+            if (ch == 0xffff)
             {
                 if (cchNewDestLength == 0)
                 {
@@ -9763,5 +9774,9 @@
 
 #pragma warning(pop)
 
+#undef __in
+#undef __out
+#undef __inline
+
 #endif  // _STRSAFE_H_INCLUDED_
 
--- include/structuredquery.h.orig	2008-03-22 06:10:42.756375000 +1000
+++ include/structuredquery.h	2008-03-24 02:28:22.507625000 +1000
@@ -233,6 +233,14 @@
 #include "ocidl.h"
 #include "propidl.h"
 
+#define __in
+#define __out
+#ifdef __cplusplus
+#define __inline inline
+#else
+#define __inline static
+#endif
+
 #ifdef __cplusplus
 extern "C"{
 #endif 
@@ -2472,6 +2480,10 @@
 }
 #endif
 
+#undef __in
+#undef __out
+#undef __inline
+
 #endif
 
 
--- include/urlmon.h.orig	2008-03-22 06:10:42.818875000 +1000
+++ include/urlmon.h	2008-03-24 02:28:32.507625000 +1000
@@ -1,3 +1,6 @@
+#if __GNUC__ >=3
+#pragma GCC system_header
+#endif
 
 
 /* this ALWAYS GENERATED file contains the definitions for the interfaces */
@@ -330,6 +333,14 @@
 #include "servprov.h"
 #include "msxml.h"
 
+#define __in
+#define __out
+#ifdef __cplusplus
+#define __inline inline
+#else
+#define __inline static
+#endif
+
 #ifdef __cplusplus
 extern "C"{
 #endif 
@@ -8880,6 +8891,10 @@
 }
 #endif
 
+#undef __in
+#undef __out
+#undef __inline
+
 #endif
 
 
--- include/wincrypt.h.orig	2008-01-18 22:17:42.000000000 +0900
+++ include/wincrypt.h	2008-03-26 21:55:55.765375000 +0900
@@ -14,6 +14,14 @@
 
 #include <specstrings.h>        /* for SAL annotations */
 
+#define __in
+#define __out
+#ifdef __cplusplus
+#define __inline inline
+#else
+#define __inline static
+#endif
+
 #if defined (_MSC_VER)
 
 #if ( _MSC_VER >= 800 )
@@ -1927,6 +1935,14 @@
 #include <bcrypt.h>
 #include <ncrypt.h>
 
+#define __in
+#define __out
+#ifdef __cplusplus
+#define __inline inline
+#else
+#define __inline static
+#endif
+
 // This type is used when the API can take either the CAPI1 HCRYPTPROV or
 // the CNG NCRYPT_KEY_HANDLE. Where appropriate, the HCRYPTPROV will be
 // converted to a NCRYPT_KEY_HANDLE via the CNG NCryptTranslateHandle().
@@ -17113,8 +17129,8 @@
     __in      DWORD                       dwFlags,
     __in_opt  PCRYPT_KEY_PROV_INFO        pKeyProvInfo,
     __in_opt  PCRYPT_ALGORITHM_IDENTIFIER pSignatureAlgorithm,
-    __in_opt  PSYSTEMTIME                 pStartTime,
-    __in_opt  PSYSTEMTIME                 pEndTime,
+    __in_opt  LPSYSTEMTIME                 pStartTime,
+    __in_opt  LPSYSTEMTIME                 pEndTime,
     __in_opt  PCERT_EXTENSIONS            pExtensions
     );
 
@@ -19174,6 +19190,10 @@
 #endif
 #endif
 
+#undef __in
+#undef __out
+#undef __inline
+
 #endif // __WINCRYPT_H__
 
 
--- include/winerror.h.orig	2008-03-20 13:39:15.127375000 +0900
+++ include/winerror.h	2008-03-20 14:33:29.097125000 +0900
@@ -23065,7 +23065,7 @@
 
 #if !defined(_HRESULT_DEFINED) && !defined(__midl)
 #define _HRESULT_DEFINED
-typedef __success(return >= 0) long HRESULT;
+typedef long HRESULT;
 #endif
 
 #ifndef __midl
--- include/wingdi.h.orig	2008-03-22 06:10:42.897000000 +1000
+++ include/wingdi.h	2008-03-24 02:29:11.523250000 +1000
@@ -9,6 +9,13 @@
 #ifndef _WINGDI_
 #define _WINGDI_
 
+#define __in
+#define __out
+#ifdef __cplusplus
+#define __inline inline
+#else
+#define __inline static
+#endif
 
 #pragma once
 
@@ -1169,11 +1176,10 @@
 typedef struct tagLOGPALETTE {
     WORD        palVersion;
     WORD        palNumEntries;
-    __field_ecount_opt(palNumEntries) PALETTEENTRY        palPalEntry[1];
+     __field_ecount_opt(palNumEntries) PALETTEENTRY        palPalEntry[1];
 } LOGPALETTE, *PLOGPALETTE, NEAR *NPLOGPALETTE, FAR *LPLOGPALETTE;
 #endif // !_LOGPALETTE_DEFINED
 
-
 /* Logical Font */
 #define LF_FACESIZE         32
 
@@ -1901,7 +1907,7 @@
 /* size of a form name string */
 #define CCHFORMNAME 32
 
-#if (_WIN32_WINNT >= ((OSVER(NTDDI_WINXPSP2)) >> 16))
+#if (_WIN32_WINNT >= ((NTDDI_WINXPSP2 & 0xFFFF0000) >> 16))
 typedef struct _devicemodeA {
     BYTE   dmDeviceName[CCHDEVICENAME];
     WORD dmSpecVersion;
@@ -2900,7 +2906,7 @@
 typedef FARPROC LINEDDAPROC;
 #endif
 
-
+WINGDIAPI int WINAPI FillRect(HDC,LPCRECT,HBRUSH);
 
 WINGDIAPI int WINAPI AddFontResourceA(__in LPCSTR);
 WINGDIAPI int WINAPI AddFontResourceW(__in LPCWSTR);
@@ -3254,7 +3260,7 @@
 WINGDIAPI int   WINAPI GetDeviceCaps( __in_opt HDC hdc, __in int index);
 WINGDIAPI int   WINAPI GetDIBits( __in HDC hdc, __in HBITMAP hbm, __in UINT start, __in UINT cLines,  __out_opt LPVOID lpvBits, __inout_xcount(sizeof(BITMAPINFOHEADER)) LPBITMAPINFO lpbmi, __in UINT usage);  // SAL actual size of lpbmi is computed from structure elements
 
-__success(return != GDI_ERROR)
+//__success(return != GDI_ERROR)
 WINGDIAPI DWORD WINAPI GetFontData (    __in HDC     hdc,
                                         __in DWORD   dwTable,
                                         __in DWORD   dwOffset,
@@ -4346,6 +4352,7 @@
 WINGDIAPI BOOL        WINAPI ColorCorrectPalette( __in HDC hdc, __in HPALETTE hPal, __in DWORD deFirst, __in DWORD num);
 #endif
 
+
 #ifndef NOMETAFILE
 
 // Enhanced metafile constants.
@@ -5424,6 +5431,10 @@
 }
 #endif
 
+#undef __in
+#undef __out
+#undef __inline
+
 #endif /* _WINGDI_ */
 
 
--- include/winsock2.h.orig	2008-03-22 06:10:42.912625000 +1000
+++ include/winsock2.h	2008-03-24 02:29:01.882625000 +1000
@@ -1,3 +1,6 @@
+#if __GNUC__ >=3
+#pragma GCC system_header
+#endif
 //$TAG BIZDEV
 //  $IPCategory:     
 //  $DealPointID:    118736
@@ -24,9 +27,9 @@
  * conditions for redistribution.
  */
 
-#ifndef _WINSOCK2API_
-#define _WINSOCK2API_
-#define _WINSOCKAPI_   /* Prevent inclusion of winsock.h in windows.h */
+#ifndef _WINSOCK2_H
+#define _WINSOCK2_H
+#define _WINSOCK_H /* to prevent later inclusion of winsock.h */
 
 #pragma once
 
@@ -66,6 +69,14 @@
 #include <windows.h>
 #endif /* _INC_WINDOWS */
 
+#define __in
+#define __out
+#ifdef __cplusplus
+#define __inline inline
+#else
+#define __inline static
+#endif
+
 /*
  * Define the current Winsock version. To build an earlier Winsock version
  * application redefine this value prior to including Winsock2.h.
@@ -1107,10 +1118,8 @@
  * registration (RNR) API
  */
 
-#ifndef _tagBLOB_DEFINED
-#define _tagBLOB_DEFINED
-#define _BLOB_DEFINED
-#define _LPBLOB_DEFINED
+#ifndef __BLOB_T_DEFINED
+#define __BLOB_T_DEFINED
 typedef struct _BLOB {
     ULONG cbSize ;
 #ifdef MIDL_PASS
@@ -3920,5 +3929,9 @@
 #endif // IPV6STRICT
 #endif //(_WIN32_WINNT >= 0x0501)
 
-#endif  /* _WINSOCK2API_ */
+#undef __in
+#undef __out
+#undef __inline
+
+#endif  /* _WINSOCK2_H */
 

--- include/winuser.h.orig	2008-07-19 14:56:51.278750000 +0900
+++ include/winuser.h	2008-07-20 08:20:08.111750000 +0900
@@ -11,6 +11,15 @@
 #ifndef _WINUSER_
 #define _WINUSER_
 
+#define __in
+#define __out
+#ifdef __cplusplus
+#define __inline inline
+#else
+#define __inline static
+#endif
+DECLARE_HANDLE(HHOOK);
+typedef CONST GUID *LPCGUID;
 
 
 #pragma once
@@ -39,7 +48,7 @@
 #define WINVER  0x0500      /* version 5.0 */
 #endif /* !WINVER */
 
-#include <stdarg.h>
+#include <../include/stdarg.h>
 
 #ifndef NOUSER
 
@@ -215,6 +224,8 @@
 #pragma warning(disable:4995)
 #endif
 
+WINUSERAPI UINT WINAPI WinExec(LPCSTR,UINT);
+
 WINUSERAPI
 int
 WINAPI
@@ -10717,7 +10728,7 @@
 #define CDS_RESET                    0x40000000
 #define CDS_NORESET                  0x10000000
 
-#include <tvout.h>
+//#include <tvout.h>
 
 /* Return values for ChangeDisplaySettings */
 #define DISP_CHANGE_SUCCESSFUL       0
@@ -12571,16 +12582,20 @@
 
 
 
-#if !defined(RC_INVOKED) /* RC complains about long symbols in #ifs */
-#if defined(ISOLATION_AWARE_ENABLED) && (ISOLATION_AWARE_ENABLED != 0)
-#include "winuser.inl"
-#endif /* ISOLATION_AWARE_ENABLED */
-#endif /* RC */
+//#if !defined(RC_INVOKED) /* RC complains about long symbols in #ifs */
+//#if defined(ISOLATION_AWARE_ENABLED) && (ISOLATION_AWARE_ENABLED != 0)
+//#include "winuser.inl"
+//#endif /* ISOLATION_AWARE_ENABLED */
+//#endif /* RC */
 
 #ifdef __cplusplus
 }
 #endif  /* __cplusplus */
 
+#undef __in
+#undef __out
+#undef __inline
+
 #endif /* !_WINUSER_ */
 
 
--- include/ws2ipdef.h.orig	2008-01-18 22:17:44.000000000 +0900
+++ include/ws2ipdef.h	2008-03-27 20:23:19.096125000 +0900
@@ -1,3 +1,6 @@
+#if __GNUC__ >=3
+#pragma GCC system_header
+#endif
 /*++
 
 Copyright (c) Microsoft Corporation. All rights reserved.
@@ -52,10 +55,10 @@
 #define WS2IPDEF_ASSERT(exp) ((VOID) 0)
 #endif
 
-#ifdef _MSC_VER
-#define WS2TCPIP_INLINE __inline
+#ifdef __cplusplus
+#define WS2TCPIP_INLINE inline
 #else
-#define WS2TCPIP_INLINE extern inline /* GNU style */
+#define WS2TCPIP_INLINE static
 #endif
     
 #include <in6addr.h>
@@ -760,7 +763,7 @@
     ULONG ipv6mr_interface;     // Interface index.
 } IPV6_MREQ, *PIPV6_MREQ;
 
-#if (NTDDI_VERSION >= NTDDI_WINXP)
+#if 0
 //
 // Structure for GROUP_REQ used by protocol independent source filters
 // (MCAST_JOIN_GROUP and MCAST_LEAVE_GROUP). 
@@ -805,6 +808,8 @@
     ULONG ipi_ifindex;    // Send/receive interface index.
 } IN_PKTINFO, *PIN_PKTINFO;
 
+#define C_ASSERT(x)
+
 C_ASSERT(sizeof(IN_PKTINFO) == 8);
 
 //
--- include/ws2tcpip.h.orig	2008-01-18 22:17:44.000000000 +0900
+++ include/ws2tcpip.h	2008-03-27 01:28:41.937250000 +0900
@@ -27,15 +27,23 @@
 #include <ws2ipdef.h>
 #include <limits.h>
 
+#define __in
+#define __out
+#ifdef __cplusplus
+#define __inline inline
+#else
+#define __inline static
+#endif
+
 /* Option to use with [gs]etsockopt at the IPPROTO_UDP level */
 
 #define UDP_NOCHECKSUM  1
 #define UDP_CHECKSUM_COVERAGE   20  /* Set/get UDP-Lite checksum coverage */
 
-#ifdef _MSC_VER
-#define WS2TCPIP_INLINE __inline
+#ifdef __cplusplus
+#define WS2TCPIP_INLINE inline
 #else
-#define WS2TCPIP_INLINE extern inline /* GNU style */
+#define WS2TCPIP_INLINE static
 #endif
 
 /* Error codes from getaddrinfo() */
@@ -835,7 +843,7 @@
     return Error;
 }
 
-#if (NTDDI_VERSION >= NTDDI_WINXP)
+#if 0
 WS2TCPIP_INLINE
 int
 setsourcefilter(
@@ -1056,5 +1064,9 @@
 #include <wspiapi.h>
 #endif
 
+#undef __in
+#undef __out
+#undef __inline
+
 #endif  /* _WS2TCPIP_H_ */
 
--- include/wspiapi.h.orig	2005-04-14 17:55:04.000000000 +0900
+++ include/wspiapi.h	2006-12-30 18:25:01.375000000 +0900
@@ -15,6 +15,9 @@
 
 #ifndef _WSPIAPI_H_
 #define _WSPIAPI_H_
+#if __GNUC__ >=3
+#pragma GCC system_header
+#endif
 
 #pragma once
 
@@ -85,6 +88,11 @@
 
 #ifdef __cplusplus
 extern "C" {
+#define _inline inline
+#define __inline inline
+#else
+#define _inline static
+#define __inline static
 #endif
     
 ////////////////////////////////////////////////////////////
@@ -1052,6 +1060,8 @@
     (*pfFreeAddrInfo)(ai);
 }
 
+#undef _inline
+#undef __inline
 #ifdef  __cplusplus
 }
 #endif
--- include/d3dtypes.h.orig	2004-09-27 12:34:16.000000000 +0900
+++ include/d3dtypes.h	2007-11-30 21:42:09.558750000 +0900
@@ -1,3 +1,6 @@
+#if __GNUC__ >=3
+#pragma GCC system_header
+#endif
 /*==========================================================================;
  *
  *  Copyright (C) Microsoft Corporation.  All Rights Reserved.
--- include/d3dx9math.h.orig	2005-07-22 17:00:18.000000000 +0900
+++ include/d3dx9math.h	2007-11-30 21:41:52.230625000 +0900
@@ -1,3 +1,6 @@
+#if __GNUC__ >=3
+#pragma GCC system_header
+#endif
 //////////////////////////////////////////////////////////////////////////////
 //
 //  Copyright (C) Microsoft Corporation.  All Rights Reserved.
--- include/d3dx9math.inl.orig	2005-03-18 17:26:56.000000000 +0900
+++ include/d3dx9math.inl	2007-11-30 21:41:38.496250000 +0900
@@ -1,3 +1,6 @@
+#if __GNUC__ >=3
+#pragma GCC system_header
+#endif
 //////////////////////////////////////////////////////////////////////////////
 //
 //  Copyright (C) Microsoft Corporation.  All Rights Reserved.
--- include/d3dx9core.h.orig	2006-03-31 12:16:02.000000000 +0900
+++ include/d3dx9core.h	2007-11-30 21:41:13.199375000 +0900
@@ -1,3 +1,6 @@
+#if __GNUC__ >=3
+#pragma GCC system_header
+#endif
 ///////////////////////////////////////////////////////////////////////////
 //
 //  Copyright (C) Microsoft Corporation.  All Rights Reserved.
--- include/msi.h.orig	2008-01-18 22:17:28.000000000 +0900
+++ include/msi.h	2008-03-24 23:41:17.249125000 +1000
@@ -59,6 +59,14 @@
 #endif // _MSI_NO_CRYPTO
 #endif //(_WIN32_MSI >= 150)
 
+#define __in
+#define __out
+#ifdef __cplusplus
+#define __inline inline
+#else
+#define __inline static
+#endif
+
 // --------------------------------------------------------------------------
 // Installer generic handle definitions
 // --------------------------------------------------------------------------
@@ -2248,5 +2256,9 @@
 // LOCALIZE END
 
 
+#undef __in
+#undef __out
+#undef __inline
+
 #endif // _MSI_H_
 
--- include/msiquery.h.orig	2008-01-18 22:17:28.000000000 +0900
+++ include/msiquery.h	2008-03-24 23:42:24.983500000 +1000
@@ -21,6 +21,14 @@
 #define _MSIQUERY_H_
 #include "msi.h"  // INSTALLSTATE
 
+#define __in
+#define __out
+#ifdef __cplusplus
+#define __inline inline
+#else
+#define __inline static
+#endif
+
 #define MSI_NULL_INTEGER 0x80000000  // integer value reserved for null
 
 // MsiOpenDatabase persist predefine values, otherwise output database path is used
@@ -1026,5 +1034,9 @@
 }
 #endif
 
+#undef __in
+#undef __out
+#undef __inline
+
 #endif // _MSIQUERY_H_
 
--- include/olectl.h.orig	2008-03-22 06:10:42.000000000 +1000
+++ include/olectl.h	2008-03-24 23:32:05.264750000 +1000
@@ -28,6 +28,14 @@
 #include <ocidl.h>
 #endif // _MAC
 
+#define __in
+#define __out
+#ifdef __cplusplus
+#define __inline inline
+#else
+#define __inline static
+#endif
+
 #ifdef _OLEAUT32_
 #define WINOLECTLAPI        STDAPI
 #define WINOLECTLAPI_(type) STDAPI_(type)
@@ -616,5 +624,9 @@
 
 #endif // defined(__MKTYPLIB__) || defined(__midl)
 
+#undef __in
+#undef __out
+#undef __inline
+
 #endif // _OLECTL_H_
 
--- include/propkeydef.h.orig	2008-01-18 22:17:32.000000000 +0900
+++ include/propkeydef.h	2008-03-22 21:56:32.734375000 +1000
@@ -2,6 +2,10 @@
 #define PID_FIRST_USABLE 2
 #endif
 
+#ifndef __MIDL_CONST
+#define __MIDL_CONST const
+#endif
+
 #ifndef REFPROPERTYKEY
 #ifdef __cplusplus
 #define REFPROPERTYKEY const PROPERTYKEY &
--- icnlude/dxtrans.h.orig	2004-09-28 00:18:32.000000000 +0900
+++ include/dxtrans.h	2007-01-02 22:08:41.640625000 +0900
@@ -1,3 +1,6 @@
+#if __GNUC__ >=3
+#pragma GCC system_header
+#endif
 
 #pragma warning( disable: 4049 )  /* more than 64k source lines */