1--- include/crtdbg.h.orig	2006-09-18 01:21:38.968750000 +0900
2+++ include/crtdbg.h	2006-09-02 23:12:50.109375000 +0900
3@@ -0,0 +1,11 @@
4+#ifndef _CRTDBG_H
5+#define _CRTDBG_H
6+#if __GNUC__ >=3
7+#pragma GCC system_header
8+#endif
9+
10+#ifndef _ASSERTE
11+#define _ASSERTE(expr) ((void)0)
12+#endif
13+
14+#endif
15--- include/excpt.h.orig	2009-01-11 04:32:43.000000000 +0900
16+++ include/excpt.h	2009-08-21 09:21:56.000000000 +0900
17@@ -16,8 +16,11 @@
18
19 /* All the headers include this file. */
20 #include <_mingw.h>
21+#include <setjmp.h>
22+#include <stdarg.h>
23
24 #include <windef.h>
25+#include <winbase.h>
26
27 /*
28  * NOTE: The constants structs and typedefs below should be defined in the
29@@ -52,7 +55,7 @@
30  * The type of function that is expected as an exception handler to be
31  * installed with __try1.
32  */
33-typedef EXCEPTION_DISPOSITION (*PEXCEPTION_HANDLER)
34+typedef EXCEPTION_DISPOSITION (* PEXCEPTION_HANDLER)
35 		(struct _EXCEPTION_RECORD*, void*, struct _CONTEXT*, void*);
36
37 /*
38@@ -93,8 +96,122 @@
39 	__asm__ ("movl (%%esp),%%eax;movl %%eax,%%fs:0;addl $8,%%esp;" \
40 	 : : : "%eax");
41
42+WINBASEAPI
43+VOID
44+WINAPI
45+RtlUnwind (
46+    IN PVOID TargetFrame OPTIONAL,
47+    IN PVOID TargetIp OPTIONAL,
48+    IN PEXCEPTION_RECORD ExceptionRecord OPTIONAL,
49+    IN PVOID ReturnValue
50+    );
51 #ifdef	__cplusplus
52 }
53+
54+class __SEHandler
55+{
56+ public:
57+  __SEHandler() {}
58+  ~__SEHandler() {}
59+  typedef int (*PF)(void *, LPEXCEPTION_POINTERS);
60+  typedef void (*PH)(void *, LPEXCEPTION_POINTERS);
61+  typedef void (*PN)(void *);
62+  void Set(jmp_buf jb, void *pdata=NULL, PF pfilter=NULL, PH phandlerbody=NULL, PN pfinal=NULL)
63+    {
64+      __builtin_memcpy(m_jmpbuf, jb, sizeof(jmp_buf));
65+      m_pData=pdata;
66+      switch (reinterpret_cast<int>(pfilter))
67+	{
68+	default:
69+	  m_filter=pfilter;
70+	  break;
71+	case EXCEPTION_CONTINUE_EXECUTION:
72+	  m_filter=DefaultFilterContinueExecution;
73+	  break;
74+	case EXCEPTION_EXECUTE_HANDLER:
75+	  m_filter=DefaultFilterExecuteHandler;
76+	  break;
77+	case EXCEPTION_CONTINUE_SEARCH:
78+	  m_filter=DefaultFilterContinueSearch;
79+	  break;
80+	}
81+      if (phandlerbody)
82+	m_handlerbody=phandlerbody;
83+      else
84+	m_handlerbody=DefaultHandler;
85+      if (pfinal)
86+	m_final=pfinal;
87+      else
88+	m_final=DefaultFinal;
89+      m_ER.pHandlerClass = this;
90+      m_ER.hp = handler;
91+      asm("movl %%fs:0, %%eax\n\t"
92+	  "movl %%eax, %0": : "m" (m_ER.prev): "%eax" );
93+      asm("movl %0, %%eax\n\t"
94+	  "movl %%eax, %%fs:0": : "r" (&m_ER): "%eax" );
95+    }
96+  void Reset()
97+    {
98+      m_final(m_pData);
99+      asm("movl %0, %%eax \n\t"
100+	  "movl %%eax, %%fs:0"
101+	  : : "m" (m_ER.prev): "%eax");
102+    }
103+ private:
104+  __SEHandler(const __SEHandler&);
105+  __SEHandler& operator=(const __SEHandler&);
106+  struct _ER {
107+    _ER* prev;
108+    PEXCEPTION_HANDLER hp;
109+    __SEHandler *pHandlerClass;
110+  };
111+  static EXCEPTION_DISPOSITION handler(
112+		     struct _EXCEPTION_RECORD *pExceptionRecord,
113+		     void * EstablisherFrame,
114+		     struct _CONTEXT *ContextRecord,
115+		     void * /*DispatcherContext*/)
116+    {
117+      __SEHandler* pThis = reinterpret_cast< _ER * >(EstablisherFrame)->pHandlerClass;
118+      if ( pExceptionRecord->ExceptionFlags & EH_UNWINDING )
119+	{
120+	  pThis->m_final(pThis->m_pData);
121+	  return ExceptionContinueSearch;
122+	}
123+      EXCEPTION_POINTERS ep={pExceptionRecord, ContextRecord};
124+      switch ( pThis->m_filter(pThis->m_pData, &ep) )
125+	{
126+	case EXCEPTION_EXECUTE_HANDLER:
127+	  RtlUnwind(EstablisherFrame, &&__set_label, pExceptionRecord, 0);
128+__set_label:
129+	  pThis->m_handlerbody(pThis->m_pData, &ep);
130+	  ContextRecord->Ebp = pThis->m_jmpbuf[0];
131+	  ContextRecord->Eip = pThis->m_jmpbuf[1];
132+	  ContextRecord->Esp = pThis->m_jmpbuf[2];
133+	  return ExceptionContinueExecution;
134+	case EXCEPTION_CONTINUE_SEARCH:
135+	  return ExceptionContinueSearch;
136+	case EXCEPTION_CONTINUE_EXECUTION:
137+	  return ExceptionContinueExecution;
138+	}
139+	  return ExceptionContinueExecution;
140+    }
141+  static int DefaultFilterContinueSearch(void *, LPEXCEPTION_POINTERS) { return EXCEPTION_CONTINUE_SEARCH; }
142+  static int DefaultFilterContinueExecution(void *, LPEXCEPTION_POINTERS) { return EXCEPTION_CONTINUE_EXECUTION; }
143+  static int DefaultFilterExecuteHandler(void *, LPEXCEPTION_POINTERS) { return EXCEPTION_EXECUTE_HANDLER; }
144+  static void DefaultHandler(void *, LPEXCEPTION_POINTERS) {}
145+  static void DefaultFinal(void *) {}
146+  typedef int (*handler_p)(
147+			   struct _EXCEPTION_RECORD *ExceptionRecord,
148+			   void * EstablisherFrame,
149+			   struct _CONTEXT *ContextRecord,
150+			   void * DispatcherContext);
151+  _ER m_ER;
152+  void *m_pData;
153+  PN m_final;
154+  PH m_handlerbody;
155+  PF m_filter;
156+  jmp_buf m_jmpbuf;
157+};
158 #endif
159
160 #endif	/* Not RC_INVOKED */
161--- include/tchar.h.orig	2009-01-11 04:32:46.000000000 +0900
162+++ include/tchar.h	2009-08-21 09:21:56.000000000 +0900
163@@ -223,6 +223,9 @@
164 #define _ttelldir	_wtelldir
165 #define _tseekdir	_wseekdir
166
167+#define _ttempnam	_wtempnam
168+
169+
170 #else	/* Not _UNICODE */
171
172 /*
173@@ -407,6 +410,8 @@
174 #define _ttelldir	telldir
175 #define _tseekdir	seekdir
176
177+#define _ttempnam	_tempnam
178+
179 #endif	/* Not _UNICODE */
180
181 /*
182--- include/amvideo.h.orig	2008-12-06 11:31:53.000000000 +0900
183+++ include/amvideo.h	2009-08-21 09:21:56.000000000 +0900
184@@ -52,10 +52,10 @@
185 	BITMAPINFOHEADER bmiHeader;
186 } VIDEOINFOHEADER;
187 typedef struct tagVIDEOINFO {
188-	RECT rcSource,
189-	RECT rcTarget,
190-	DWORD dwBitRate,
191-	DWORD dwBitErrorRate,
192+	RECT rcSource;
193+	RECT rcTarget;
194+	DWORD dwBitRate;
195+	DWORD dwBitErrorRate;
196 	REFERENCE_TIME AvgTimePerFrame;
197 	BITMAPINFOHEADER bmiHeader;
198 	union {
199--- include/basetyps.h.orig	2008-12-06 11:31:53.000000000 +0900
200+++ include/basetyps.h	2009-08-21 09:21:56.000000000 +0900
201@@ -80,6 +80,8 @@
202    CONST_VTABLE struct i##Vtbl
203 #  define DECLARE_INTERFACE_(i,b) DECLARE_INTERFACE(i)
204 # endif
205+# define DECLARE_INTERFACE_IID(i,s) EXTERN_C const IID IID_##i; DECLARE_INTERFACE(i)
206+# define DECLARE_INTERFACE_IID_(i,b,s) EXTERN_C const IID IID_##i; DECLARE_INTERFACE_(i,b)
207 # define BEGIN_INTERFACE
208 # define END_INTERFACE
209
210--- include/objidl.h.orig	2008-12-06 11:32:04.000000000 +0900
211+++ include/objidl.h	2009-08-21 09:21:56.000000000 +0900
212@@ -1,3 +1,6 @@
213+#include <windows.h>
214+#include <ole2.h>
215+
216 #ifndef _OBJIDL_H
217 #define _OBJIDL_H
218 #if __GNUC__ >= 3
219@@ -880,8 +883,8 @@
220 	STDMETHOD(QueryInterface)(THIS_ REFIID,PVOID*) PURE;
221 	STDMETHOD_(ULONG,AddRef)(THIS) PURE;
222 	STDMETHOD_(ULONG,Release)(THIS) PURE;
223-	STDMETHOD(AddConnection)(THIS_ DWORD,DWORD) PURE;
224-	STDMETHOD(ReleaseConnection)(THIS_ DWORD,DWORD,BOOL) PURE;
225+	STDMETHOD_(DWORD,AddConnection)(THIS_ DWORD,DWORD) PURE;
226+	STDMETHOD_(DWORD,ReleaseConnection)(THIS_ DWORD,DWORD,BOOL) PURE;
227 };
228 #undef INTERFACE
229
230--- include/specstrings.h.orig	2008-12-06 11:32:09.000000000 +0900
231+++ include/specstrings.h	2009-08-21 09:21:56.000000000 +0900
232@@ -11,8 +11,31 @@
233 /* __in and __out currently conflict with libstdc++, use with caution */
234
235
236+#define __RPC__deref_inout_opt
237+#define __RPC__deref_opt_inout_ecount_full_opt(size)
238+#define __RPC__deref_opt_inout_opt
239+#define __RPC__deref_out
240+#define __RPC__deref_out_ecount_full_opt(size)
241+#define __RPC__deref_out_opt
242+#define __RPC__deref_out_opt_string
243+#define __RPC__in
244+#define __RPC__in_ecount_full(size)
245+#define __RPC__in_ecount_full_opt(size)
246+#define __RPC__in_opt
247+#define __RPC__inout
248+#define __RPC__inout_ecount_full(size)
249+#define __RPC__inout_ecount_full_opt(size)
250+#define __RPC__inout_opt
251+#define __RPC__out
252+#define __RPC__out_ecount_full(size)
253+#define __RPC__out_ecount_full_string(size)
254+#define __RPC__out_ecount_part(size,init)
255+#define __RPC_unique_pointer
256 #define __bcount(size)
257 #define __bcount_opt(size)
258+#define __callback
259+#define __checkReturn
260+#define __deref
261 #define __deref_bcount(size)
262 #define __deref_bcount_opt(size)
263 #define __deref_ecount(size)
264@@ -36,6 +59,7 @@
265 #define __deref_inout_ecount_opt(size)
266 #define __deref_inout_ecount_part(size,length)
267 #define __deref_inout_ecount_part_opt(size,length)
268+#define __deref_inout_ecount_z(size)
269 #define __deref_inout_opt
270 #define __deref_opt_bcount(size)
271 #define __deref_opt_bcount_opt(size)
272@@ -89,14 +113,23 @@
273 #define __deref_out_ecount_part(size,length)
274 #define __deref_out_ecount_part_opt(size,length)
275 #define __deref_out_opt
276+#define __deref_out_z
277+#define __deref_out_z_opt
278 #define __ecount(size)
279 #define __ecount_opt(size)
280+#define __field_bcount(size)
281+#define __field_ecount(size)
282+#define __field_ecount_opt(size)
283+#define __format_string
284+#define __gdi_entry
285 #define __in
286 #define __in_bcount(size)
287 #define __in_bcount_opt(size)
288 #define __in_ecount(size)
289 #define __in_ecount_opt(size)
290 #define __in_opt
291+#define __in_xcount(size)
292+#define __in_z_opt
293 #define __inout
294 #define __inout_bcount(size)
295 #define __inout_bcount_full(size)
296@@ -111,7 +144,12 @@
297 #define __inout_ecount_part(size,length)
298 #define __inout_ecount_part_opt(size,length)
299 #define __inout_opt
300+#define __inout_xcount(size)
301+#define __notnull
302+#define __nullnullterminated
303+#define __nullterminated
304 #define __out
305+#define __out_awcount(expr,size)
306 #define __out_bcount(size)
307 #define __out_bcount_full(size)
308 #define __out_bcount_full_opt(size)
309@@ -119,12 +157,20 @@
310 #define __out_bcount_part(size,length)
311 #define __out_bcount_part_opt(size,length)
312 #define __out_ecount(size)
313+#define __out_ecount(size)
314 #define __out_ecount_full(size)
315 #define __out_ecount_full_opt(size)
316 #define __out_ecount_opt(size)
317 #define __out_ecount_part(size,length)
318 #define __out_ecount_part_opt(size,length)
319 #define __out_opt
320+#define __out_xcount(size)
321+#define __out_xcount_opt(size)
322+#define __reserved
323+#define __struct_bcount(size)
324+#define __success(expr)
325+#define __typefix(ctype)
326+#define __unaligned
327
328
329 #endif /*_SPECSTRINGS_H */
330--- include/uxtheme.h.orig	2008-12-06 11:32:11.000000000 +0900
331+++ include/uxtheme.h	2010-01-22 14:50:56.327000000 +0900
332@@ -10,7 +10,7 @@
333 extern "C" {
334 #endif
335
336-#if (_WIN32_WINNT >= 0x0501)
337+#if (_WIN32_WINNT >= 0x0500)
338 #define DTBG_CLIPRECT 0x00000001
339 #define DTBG_DRAWSOLID 0x00000002
340 #define DTBG_OMITBORDER 0x00000004
341@@ -35,6 +35,7 @@
342 #define HTTB_RESIZINGBORDER (HTTB_RESIZINGBORDER_LEFT|HTTB_RESIZINGBORDER_TOP|HTTB_RESIZINGBORDER_RIGHT|HTTB_RESIZINGBORDER_BOTTOM)
343 #define HTTB_SIZINGTEMPLATE 0x0100
344 #define HTTB_SYSTEMSIZINGMARGINS 0x0200
345+#if 0
346 #define TMT_DISPLAYNAME 0x0259
347 #define TMT_TOOLTIP 0x025A
348 #define TMT_COMPANY 0x025B
349@@ -186,6 +187,7 @@
350 #define BT_IMAGEFILE  0x0000
351 #define BT_BORDERFILL 0x0001
352 #define BT_NONE       0x0002
353+#endif
354
355 typedef enum PROPERTYORIGIN {
356 	PO_STATE = 0,
357--- include/winbase.h.orig	2008-12-06 11:32:11.000000000 +0900
358+++ include/winbase.h	2009-08-21 09:21:56.000000000 +0900
359@@ -1354,8 +1354,8 @@
360 WINBASEAPI HANDLE WINAPI FindFirstFileExW(LPCWSTR,FINDEX_INFO_LEVELS,PVOID,FINDEX_SEARCH_OPS,PVOID,DWORD);
361 WINBASEAPI BOOL WINAPI FindFirstFreeAce(PACL,PVOID*);
362 #if (_WIN32_WINNT >= 0x0500)
363-WINBASEAPI HANDLE WINAPI FindFirstVolumeA(LPCSTR,DWORD);
364-WINBASEAPI HANDLE WINAPI FindFirstVolumeW(LPCWSTR,DWORD);
365+WINBASEAPI HANDLE WINAPI FindFirstVolumeA(LPSTR,DWORD);
366+WINBASEAPI HANDLE WINAPI FindFirstVolumeW(LPWSTR,DWORD);
367 WINBASEAPI HANDLE WINAPI FindFirstVolumeMountPointA(LPSTR,LPSTR,DWORD);
368 WINBASEAPI HANDLE WINAPI FindFirstVolumeMountPointW(LPWSTR,LPWSTR,DWORD);
369 #endif
370@@ -1363,7 +1363,7 @@
371 WINBASEAPI BOOL WINAPI FindNextFileA(HANDLE,LPWIN32_FIND_DATAA);
372 WINBASEAPI BOOL WINAPI FindNextFileW(HANDLE,LPWIN32_FIND_DATAW);
373 #if (_WIN32_WINNT >= 0x0500)
374-WINBASEAPI BOOL WINAPI FindNextVolumeA(HANDLE,LPCSTR,DWORD);
375+WINBASEAPI BOOL WINAPI FindNextVolumeA(HANDLE,LPSTR,DWORD);
376 WINBASEAPI BOOL WINAPI FindNextVolumeW(HANDLE,LPWSTR,DWORD);
377 WINBASEAPI BOOL WINAPI FindNextVolumeMountPointA(HANDLE,LPSTR,DWORD);
378 WINBASEAPI BOOL WINAPI FindNextVolumeMountPointW(HANDLE,LPWSTR,DWORD);
379@@ -1475,10 +1475,10 @@
380 WINBASEAPI DWORD WINAPI GetLogicalDrives(void);
381 WINBASEAPI DWORD WINAPI GetLogicalDriveStringsA(DWORD,LPSTR);
382 WINBASEAPI DWORD WINAPI GetLogicalDriveStringsW(DWORD,LPWSTR);
383-#if (_WIN32_WINNT >= 0x0500 || _WIN32_WINDOWS >= 0x0410)
384+//#if (_WIN32_WINNT >= 0x0500 || _WIN32_WINDOWS >= 0x0410)
385 WINBASEAPI DWORD WINAPI GetLongPathNameA(LPCSTR,LPSTR,DWORD);
386 WINBASEAPI DWORD WINAPI GetLongPathNameW(LPCWSTR,LPWSTR,DWORD);
387-#endif
388+//#endif
389 WINBASEAPI BOOL WINAPI GetMailslotInfo(HANDLE,PDWORD,PDWORD,PDWORD,PDWORD);
390 WINBASEAPI DWORD WINAPI GetModuleFileNameA(HINSTANCE,LPSTR,DWORD);
391 WINBASEAPI DWORD WINAPI GetModuleFileNameW(HINSTANCE,LPWSTR,DWORD);
392@@ -1519,9 +1519,9 @@
393 #endif
394 WINBASEAPI HANDLE WINAPI GetProcessHeap(VOID);
395 WINBASEAPI DWORD WINAPI GetProcessHeaps(DWORD,PHANDLE);
396-#if (_WIN32_WINNT >= 0x0501)
397+//#if (_WIN32_WINNT >= 0x0501)
398 WINBASEAPI DWORD WINAPI GetProcessId(HANDLE);
399-#endif
400+//#endif
401 #if (_WIN32_WINNT >= 0x0500)
402 WINBASEAPI BOOL WINAPI GetProcessIoCounters(HANDLE,PIO_COUNTERS);
403 #endif
404@@ -1802,9 +1802,9 @@
405 WINBASEAPI BOOL WINAPI OpenProcessToken(HANDLE,DWORD,PHANDLE);
406 WINBASEAPI HANDLE WINAPI OpenSemaphoreA(DWORD,BOOL,LPCSTR);
407 WINBASEAPI HANDLE WINAPI OpenSemaphoreW(DWORD,BOOL,LPCWSTR);
408-#if (_WIN32_WINNT >= 0x0500) || (_WIN32_WINDOWS >= 0x0490)
409+//#if (_WIN32_WINNT >= 0x0500) || (_WIN32_WINDOWS >= 0x0490)
410 WINBASEAPI HANDLE WINAPI OpenThread(DWORD,BOOL,DWORD);
411-#endif
412+//#endif
413 WINBASEAPI BOOL WINAPI OpenThreadToken(HANDLE,DWORD,BOOL,PHANDLE);
414 WINBASEAPI HANDLE WINAPI OpenWaitableTimerA(DWORD,BOOL,LPCSTR);
415 WINBASEAPI HANDLE WINAPI OpenWaitableTimerW(DWORD,BOOL,LPCWSTR);
416@@ -2029,6 +2029,7 @@
417 WINBASEAPI DWORD WINAPI WaitForSingleObjectEx(HANDLE,DWORD,BOOL);
418 WINBASEAPI BOOL WINAPI WaitNamedPipeA(LPCSTR,DWORD);
419 WINBASEAPI BOOL WINAPI WaitNamedPipeW(LPCWSTR,DWORD);
420+WINBASEAPI UINT WINAPI WinExec(LPCSTR,UINT);
421 WINBASEAPI BOOL WINAPI WinLoadTrustProvider(GUID*);
422 WINBASEAPI BOOL WINAPI WriteFile(HANDLE,PCVOID,DWORD,PDWORD,LPOVERLAPPED);
423 WINBASEAPI BOOL WINAPI WriteFileEx(HANDLE,PCVOID,DWORD,LPOVERLAPPED,LPOVERLAPPED_COMPLETION_ROUTINE);
424@@ -2151,9 +2152,9 @@
425 #define GetFileAttributesEx GetFileAttributesExW
426 #define GetFullPathName GetFullPathNameW
427 #define GetLogicalDriveStrings GetLogicalDriveStringsW
428-#if (_WIN32_WINNT >= 0x0500 || _WIN32_WINDOWS >= 0x0410)
429+//#if (_WIN32_WINNT >= 0x0500 || _WIN32_WINDOWS >= 0x0410)
430 #define GetLongPathName GetLongPathNameW
431-#endif
432+//#endif
433 #define GetModuleFileName GetModuleFileNameW
434 #define GetModuleHandle GetModuleHandleW
435 #if (_WIN32_WINNT >= 0x0500)
436@@ -2346,9 +2347,9 @@
437 #define GetFileAttributesEx GetFileAttributesExA
438 #define GetFullPathName GetFullPathNameA
439 #define GetLogicalDriveStrings GetLogicalDriveStringsA
440-#if (_WIN32_WINNT >= 0x0500 || _WIN32_WINDOWS >= 0x0410)
441+//#if (_WIN32_WINNT >= 0x0500 || _WIN32_WINDOWS >= 0x0410)
442 #define GetLongPathName GetLongPathNameA
443-#endif
444+//#endif
445 #define GetNamedPipeHandleState GetNamedPipeHandleStateA
446 #define GetModuleHandle GetModuleHandleA
447 #if (_WIN32_WINNT >= 0x0500)
448--- include/windef.h.orig	2008-12-06 11:32:12.000000000 +0900
449+++ include/windef.h	2009-08-21 09:21:56.000000000 +0900
450@@ -251,6 +251,7 @@
451 typedef unsigned int UINT,*PUINT,*LPUINT;
452
453 #include <winnt.h>
454+#include <specstrings.h>
455
456 typedef UINT_PTR WPARAM;
457 typedef LONG_PTR LPARAM;
458--- include/wininet.h.orig	2008-12-06 11:32:13.000000000 +0900
459+++ include/wininet.h	2009-08-21 09:21:56.000000000 +0900
460@@ -868,6 +868,7 @@
461 BOOL WINAPI InternetAutodial(DWORD,DWORD);
462 BOOL WINAPI InternetAutodialHangup(DWORD);
463 BOOL WINAPI InternetGetConnectedState(LPDWORD,DWORD);
464+BOOL WINAPI InternetGetConnectedStateEx(LPDWORD,LPTSTR,DWORD,DWORD);
465 BOOL WINAPI InternetSetDialState(LPCTSTR,DWORD,DWORD);
466 BOOL WINAPI InternetReadFileExA(HINTERNET,LPINTERNET_BUFFERSA,DWORD,DWORD_PTR);
467 BOOL WINAPI InternetReadFileExW(HINTERNET,LPINTERNET_BUFFERSW,DWORD,DWORD_PTR);
468--- include/winver.h.orig	2008-12-06 11:32:14.000000000 +0900
469+++ include/winver.h	2009-08-21 09:21:56.000000000 +0900
470@@ -101,10 +101,10 @@
471 DWORD WINAPI VerFindFileW(DWORD,LPWSTR,LPWSTR,LPWSTR,LPWSTR,PUINT,LPWSTR,PUINT);
472 DWORD WINAPI VerInstallFileA(DWORD,LPSTR,LPSTR,LPSTR,LPSTR,LPSTR,LPSTR,PUINT);
473 DWORD WINAPI VerInstallFileW(DWORD,LPWSTR,LPWSTR,LPWSTR,LPWSTR,LPWSTR,LPWSTR,PUINT);
474-DWORD WINAPI GetFileVersionInfoSizeA(LPCSTR,PDWORD);
475-DWORD WINAPI GetFileVersionInfoSizeW(LPCWSTR,PDWORD);
476-BOOL WINAPI GetFileVersionInfoA(LPCSTR,DWORD,DWORD,PVOID);
477-BOOL WINAPI GetFileVersionInfoW(LPCWSTR,DWORD,DWORD,PVOID);
478+DWORD WINAPI GetFileVersionInfoSizeA(LPSTR,PDWORD);
479+DWORD WINAPI GetFileVersionInfoSizeW(LPWSTR,PDWORD);
480+BOOL WINAPI GetFileVersionInfoA(LPSTR,DWORD,DWORD,PVOID);
481+BOOL WINAPI GetFileVersionInfoW(LPWSTR,DWORD,DWORD,PVOID);
482 DWORD WINAPI VerLanguageNameA(DWORD,LPSTR,DWORD);
483 DWORD WINAPI VerLanguageNameW(DWORD,LPWSTR,DWORD);
484 BOOL WINAPI VerQueryValueA(const LPVOID,LPSTR,LPVOID*,PUINT);
485--- include/wtypes.h.orig	2008-12-06 11:32:14.000000000 +0900
486+++ include/wtypes.h	2009-08-21 09:21:56.000000000 +0900
487@@ -66,6 +66,19 @@
488 	unsigned short asData[1];
489 }FLAGGED_WORD_BLOB;
490
491+typedef struct _COAUTHIDENTITY
492+    {
493+    /* [size_is] */ USHORT *User;
494+    /* [range] */ ULONG UserLength;
495+    /* [size_is] */ USHORT *Domain;
496+    /* [range] */ ULONG DomainLength;
497+    /* [size_is] */ USHORT *Password;
498+    /* [range] */ ULONG PasswordLength;
499+    ULONG Flags;
500+    } 	COAUTHIDENTITY;
501+
502+typedef WORD CLIPFORMAT,*LPCLIPFORMAT;
503+
504 #ifndef OLE2ANSI
505 typedef WCHAR OLECHAR;
506 typedef LPWSTR LPOLESTR;
507@@ -94,6 +107,7 @@
508 	}_STRUCT_NAME(s);
509 	LONGLONG int64;
510 } CY;
511+typedef union tagCY *LPCY;
512 typedef double DATE;
513 typedef struct  tagBSTRBLOB {
514 	ULONG cbSize;
515@@ -165,6 +179,52 @@
516 #define DECIMAL_SETZERO(d) {(d).Lo64=(d).Hi32=(d).signscale=0;}
517 #endif
518 typedef void *HMETAFILEPICT;
519+
520+typedef enum tagTYSPEC {
521+    TYSPEC_CLSID,
522+    TYSPEC_FILEEXT,
523+    TYSPEC_MIMETYPE,
524+    TYSPEC_FILENAME,
525+    TYSPEC_PROGID,
526+    TYSPEC_PACKAGENAME,
527+    TYSPEC_OBJECTID
528+} TYSPEC;
529+
530+typedef union {
531+        CLSID clsid;
532+        LPOLESTR pFileExt;
533+        LPOLESTR pMimeType;
534+        LPOLESTR pProgId;
535+        LPOLESTR pFileName;
536+        struct {
537+        LPOLESTR pPackageName;
538+        GUID PolicyId;
539+        } ByName;
540+        struct {
541+        GUID ObjectId;
542+        GUID PolicyId;
543+        } ByObjectId;
544+} uCLSSPEC;
545+
546+typedef struct tagCSPLATFORM {
547+   DWORD dwContext;
548+   DWORD dwVersionHi;
549+   DWORD dwVersionLo;
550+   DWORD dwProcessorArch;
551+} CSPLATFORM;
552+
553+typedef struct tagQUERYCONTEXT {
554+  DWORD dwContext;
555+  CSPLATFORM Platform;
556+  LCID Locale;
557+  DWORD dwVersionHi;
558+  DWORD dwVersionLo;
559+} QUERYCONTEXT;
560+typedef struct
561+{
562+	GUID fmtid;
563+	DWORD pid;
564+} PROPERTYKEY;
565 #ifdef __cplusplus
566 }
567 #endif
568--- include/adoctint.h.orig	2008-01-18 22:17:10.000000000 +0900
569+++ include/adoctint.h	2009-08-21 09:21:56.000000000 +0900
570@@ -11,6 +11,9 @@
571 //--------------------------------------------------------------------
572 #ifndef _ADOCTINT_H_
573 #define _ADOCTINT_H_
574+#if __GNUC__ >=3
575+#pragma GCC system_header
576+#endif
577
578 #ifndef _INC_TCHAR
579 #include <tchar.h>
580@@ -2489,11 +2492,11 @@
581 #endif 	/* __Procedure_INTERFACE_DEFINED__ */
582 EXTERN_C const CLSID CLSID_Catalog;
583 #ifdef __cplusplus
584-Catalog;
585+//Catalog;
586 #endif
587 EXTERN_C const CLSID CLSID_Table;
588 #ifdef __cplusplus
589-Table;
590+//Table;
591 #endif
592 #ifndef __Property_INTERFACE_DEFINED__
593 #define __Property_INTERFACE_DEFINED__
594@@ -2635,23 +2638,23 @@
595 #endif 	/* __Property_INTERFACE_DEFINED__ */
596 EXTERN_C const CLSID CLSID_Group;
597 #ifdef __cplusplus
598-Group;
599+//Group;
600 #endif
601 EXTERN_C const CLSID CLSID_User;
602 #ifdef __cplusplus
603-User;
604+//User;
605 #endif
606 EXTERN_C const CLSID CLSID_Column;
607 #ifdef __cplusplus
608-Column;
609+//Column;
610 #endif
611 EXTERN_C const CLSID CLSID_Index;
612 #ifdef __cplusplus
613-Index;
614+//Index;
615 #endif
616 EXTERN_C const CLSID CLSID_Key;
617 #ifdef __cplusplus
618-Key;
619+//Key;
620 #endif
621 #ifndef __Tables_INTERFACE_DEFINED__
622 #define __Tables_INTERFACE_DEFINED__
623@@ -3332,8 +3335,8 @@
624             /* [in] */ VARIANT Item,
625             /* [defaultvalue][in] */ KeyTypeEnum Type,
626             /* [optional][in] */ VARIANT Column,
627-            /* [defaultvalue][in] */ __RPC__in BSTR RelatedADOTable = L"",
628-            /* [defaultvalue][in] */ __RPC__in BSTR RelatedADOColumn = L"") = 0;
629+            /* [defaultvalue][in] */ __RPC__in BSTR RelatedADOTable = const_cast<BSTR>(L""),
630+            /* [defaultvalue][in] */ __RPC__in BSTR RelatedADOColumn = const_cast<BSTR>(L"")) = 0;
631
632         virtual /* [helpcontext] */ HRESULT STDMETHODCALLTYPE Delete(
633             /* [in] */ VARIANT Item) = 0;
634--- include/adodef.h.orig	2008-01-18 22:17:10.000000000 +0900
635+++ include/adodef.h	2009-08-21 09:21:56.000000000 +0900
636@@ -12,6 +12,9 @@
637
638 #ifndef _ADODEF_H_
639 #define _ADODEF_H_
640+#if __GNUC__ >=3
641+#pragma GCC system_header
642+#endif
643
644 // TYPELIB MAJOR VERSIONS
645 #define ADO_MAJOR			6
646--- include/adoguids.h.orig	2008-01-18 22:17:10.000000000 +0900
647+++ include/adoguids.h	2009-08-21 09:21:56.000000000 +0900
648@@ -11,6 +11,10 @@
649 //-----------------------------------------------------------------------------
650
651
652+#if __GNUC__ >=3
653+#pragma GCC system_header
654+#endif
655+
656 #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
657
658 #if defined(__midl) || defined(GEN_MIDL)
659--- include/adoint.h.orig	2008-01-18 22:17:10.000000000 +0900
660+++ include/adoint.h	2009-08-21 09:21:56.000000000 +0900
661@@ -11,6 +11,9 @@
662 //--------------------------------------------------------------------
663 #ifndef _ADOINT_H_
664 #define _ADOINT_H_
665+#if __GNUC__ >=3
666+#pragma GCC system_header
667+#endif
668
669 #ifndef _INC_TCHAR
670 #include <tchar.h>
671@@ -3494,7 +3497,7 @@
672 #endif 	/* __ADOConnectionConstruction_INTERFACE_DEFINED__ */
673 EXTERN_C const CLSID CLSID_Connection;
674 #ifdef __cplusplus
675-Connection;
676+//Connection;
677 #endif
678 #ifndef ___Record_INTERFACE_DEFINED__
679 #define ___Record_INTERFACE_DEFINED__
680@@ -3793,7 +3796,7 @@
681 #endif 	/* ___Record_INTERFACE_DEFINED__ */
682 EXTERN_C const CLSID CLSID_Record;
683 #ifdef __cplusplus
684-Record;
685+//Record;
686 #endif
687 #ifndef ___Stream_INTERFACE_DEFINED__
688 #define ___Stream_INTERFACE_DEFINED__
689@@ -4123,7 +4126,7 @@
690 #endif 	/* ___Stream_INTERFACE_DEFINED__ */
691 EXTERN_C const CLSID CLSID_Stream;
692 #ifdef __cplusplus
693-Stream;
694+//Stream;
695 #endif
696 #ifndef __ADORecordConstruction_INTERFACE_DEFINED__
697 #define __ADORecordConstruction_INTERFACE_DEFINED__
698@@ -4405,11 +4408,11 @@
699 #endif 	/* __ADOCommandConstruction_INTERFACE_DEFINED__ */
700 EXTERN_C const CLSID CLSID_Command;
701 #ifdef __cplusplus
702-Command;
703+//Command;
704 #endif
705 EXTERN_C const CLSID CLSID_Recordset;
706 #ifdef __cplusplus
707-Recordset;
708+//Recordset;
709 #endif
710 #ifndef __Recordset15_INTERFACE_DEFINED__
711 #define __Recordset15_INTERFACE_DEFINED__
712@@ -8305,7 +8308,7 @@
713 #endif 	/* ___Parameter_INTERFACE_DEFINED__ */
714 EXTERN_C const CLSID CLSID_Parameter;
715 #ifdef __cplusplus
716-Parameter;
717+//Parameter;
718 #endif
719 #ifndef __Parameters_INTERFACE_DEFINED__
720 #define __Parameters_INTERFACE_DEFINED__
721--- include/bcrypt.h.orig	2008-01-18 22:17:12.000000000 +0900
722+++ include/bcrypt.h	2008-04-10 22:57:54.410750000 +0900
723@@ -40,12 +40,6 @@
724 #define OPTIONAL
725 #endif
726
727-#if !defined(__midl)
728-#define BCRYPT_STRUCT_ALIGNMENT __declspec(align(BCRYPT_OBJECT_ALIGNMENT))
729-#else
730-#define BCRYPT_STRUCT_ALIGNMENT
731-#endif /*!defined(__midl)*/
732-
733 //
734 //  Alignment macros
735 //
736@@ -57,11 +51,7 @@
737  #define BCRYPT_OBJECT_ALIGNMENT    4
738 #endif
739
740-#if !defined(__midl)
741-#define BCRYPT_STRUCT_ALIGNMENT __declspec(align(BCRYPT_OBJECT_ALIGNMENT))
742-#else
743 #define BCRYPT_STRUCT_ALIGNMENT
744-#endif /*!defined(__midl)*/
745
746 //
747 // DeriveKey KDF Types
748@@ -108,7 +98,11 @@
749
750 typedef BCRYPT_KEY_LENGTHS_STRUCT BCRYPT_AUTH_TAG_LENGTHS_STRUCT;
751
752-#pragma pack(push, BCRYPT_OBJECT_ALIGNMENT)
753+#if defined(_IA64_) || defined(_AMD64_)
754+#pragma pack(push, 8)
755+#else
756+#pragma pack(push, 4)
757+#endif
758 typedef BCRYPT_STRUCT_ALIGNMENT struct _BCRYPT_OID
759 {
760     ULONG   cbOID;
761--- include/commctrl.h.orig	2008-01-18 22:17:14.000000000 +0900
762+++ include/commctrl.h	2009-08-21 09:21:56.000000000 +0900
763@@ -14,6 +14,14 @@
764 #ifndef _INC_COMMCTRL
765 #define _INC_COMMCTRL
766
767+#define __in
768+#define __out
769+#ifdef __cplusplus
770+#define __inline inline
771+#else
772+#define __inline static __inline__
773+#endif
774+
775 #if defined(_MSC_VER) && (_MSC_VER >= 1200)
776 #pragma warning(push)
777 #pragma warning(disable:4001) /* nonstandard extension : single line comment */
778@@ -369,8 +377,10 @@
779
780 // Shell reserved               (0U-580U) -  (0U-589U)
781
782+#ifndef CDN_FIRST
783 #define CDN_FIRST               (0U-601U)       // common dialog (new)
784 #define CDN_LAST                (0U-699U)
785+#endif
786
787 #define TBN_FIRST               (0U-700U)       // toolbar
788 #define TBN_LAST                (0U-720U)
789@@ -683,7 +693,7 @@
790 #define ILP_DOWNLEVEL       1           // Write or reads the stream using downlevel sematics.
791
792
793-WINCOMMCTRLAPI HRESULT WINAPI ImageList_ReadEx(DWORD dwFlags, LPSTREAM pstm, REFIID riid, PVOID* ppv);
794+//WINCOMMCTRLAPI HRESULT WINAPI ImageList_ReadEx(DWORD dwFlags, LPSTREAM pstm, REFIID riid, PVOID* ppv);
795 WINCOMMCTRLAPI HRESULT WINAPI ImageList_WriteEx(HIMAGELIST himl, DWORD dwFlags, LPSTREAM pstm);
796 #endif
797
798@@ -713,7 +723,7 @@
799 #endif
800
801 #if (_WIN32_WINNT >= 0x0501)
802-WINCOMMCTRLAPI HRESULT WINAPI HIMAGELIST_QueryInterface(HIMAGELIST himl, REFIID riid, void** ppv);
803+//WINCOMMCTRLAPI HRESULT WINAPI HIMAGELIST_QueryInterface(HIMAGELIST himl, REFIID riid, void** ppv);
804
805 #ifdef __cplusplus
806 FORCEINLINE HIMAGELIST IImageListToHIMAGELIST(struct IImageList *himl)
807@@ -8056,8 +8066,10 @@
808 #if (_WIN32_WINNT >= 0x0501)
809
810 // custom combobox control messages
811+#ifndef CB_SETMINVISIBLE
812 #define CB_SETMINVISIBLE        (CBM_FIRST + 1)
813 #define CB_GETMINVISIBLE        (CBM_FIRST + 2)
814+#endif
815 #define CB_SETCUEBANNER         (CBM_FIRST + 3)
816 #define CB_GETCUEBANNER         (CBM_FIRST + 4)
817
818@@ -8651,7 +8663,7 @@
819
820 #if !defined(RC_INVOKED) /* RC complains about long symbols in #ifs */
821 #if defined(ISOLATION_AWARE_ENABLED) && (ISOLATION_AWARE_ENABLED != 0)
822-#include "commctrl.inl"
823+//#include "commctrl.inl"
824 #endif /* ISOLATION_AWARE_ENABLED */
825 #endif /* RC */
826
827@@ -8666,6 +8678,10 @@
828 #pragma warning(pop)
829 #endif
830
831+#undef __in
832+#undef __out
833+#undef __inline
834+
835 #endif  /* _INC_COMMCTRL */
836
837
838--- include/control.h.orig	2008-01-18 22:17:14.000000000 +0900
839+++ include/control.h	2009-08-21 09:21:56.000000000 +0900
840@@ -1,3 +1,6 @@
841+#if __GNUC__ >=3
842+#pragma GCC system_header
843+#endif
844
845
846 /* this ALWAYS GENERATED file contains the definitions for the interfaces */
847--- include/dispex.h.orig	2008-01-18 22:17:16.000000000 +0900
848+++ include/dispex.h	2009-08-21 09:21:56.000000000 +0900
849@@ -1,3 +1,6 @@
850+#if __GNUC__ >=3
851+#pragma GCC system_header
852+#endif
853
854
855 /* this ALWAYS GENERATED file contains the definitions for the interfaces */
856--- include/filter.h.orig	2008-01-18 22:17:18.000000000 +0900
857+++ include/filter.h	2009-08-21 09:21:56.000000000 +0900
858@@ -1,3 +1,6 @@
859+#if __GNUC__ >=3
860+#pragma GCC system_header
861+#endif
862
863
864 /* this ALWAYS GENERATED file contains the definitions for the interfaces */
865--- include/gdiplusbitmap.h.orig	2008-01-18 22:17:46.000000000 +0900
866+++ include/gdiplusbitmap.h	2009-08-21 09:21:56.000000000 +0900
867@@ -1,3 +1,6 @@
868+#if __GNUC__ >=3
869+#pragma GCC system_header
870+#endif
871 /**************************************************************************\
872 *
873 * Copyright (c) 1998-2001, Microsoft Corp.  All Rights Reserved.
874--- include/gdiplusbrush.h.orig	2008-01-18 22:17:46.000000000 +0900
875+++ include/gdiplusbrush.h	2009-08-21 09:21:56.000000000 +0900
876@@ -1,3 +1,6 @@
877+#if __GNUC__ >=3
878+#pragma GCC system_header
879+#endif
880 /**************************************************************************\
881 *
882 * Copyright (c) 1998-2001, Microsoft Corp.  All Rights Reserved.
883--- include/gdiplusenums.h.orig	2008-01-18 22:17:46.000000000 +0900
884+++ include/gdiplusenums.h	2009-08-21 09:21:56.000000000 +0900
885@@ -542,7 +542,7 @@
886
887 #define GDIP_EMFPLUS_RECORD_BASE        0x00004000
888 #define GDIP_WMF_RECORD_BASE            0x00010000
889-#define GDIP_WMF_RECORD_TO_EMFPLUS(n)   ((EmfPlusRecordType)((n) | GDIP_WMF_RECORD_BASE))
890+#define GDIP_WMF_RECORD_TO_EMFPLUS(n)   ((n) | GDIP_WMF_RECORD_BASE)
891 #define GDIP_EMFPLUS_RECORD_TO_WMF(n)   ((n) & (~GDIP_WMF_RECORD_BASE))
892 #define GDIP_IS_WMF_RECORDTYPE(n)       (((n) & GDIP_WMF_RECORD_BASE) != 0)
893
894--- include/gdiplusfont.h.orig	2008-01-18 22:17:46.000000000 +0900
895+++ include/gdiplusfont.h	2009-08-21 09:21:56.000000000 +0900
896@@ -1,3 +1,6 @@
897+#if __GNUC__ >=3
898+#pragma GCC system_header
899+#endif
900 /**************************************************************************\
901 *
902 * Copyright (c) 1998-2001, Microsoft Corp.  All Rights Reserved.
903--- include/gdiplusheaders.h.orig	2008-01-18 22:17:46.000000000 +0900
904+++ include/gdiplusheaders.h	2008-03-28 21:44:34.907750000 +0900
905@@ -704,7 +704,7 @@
906
907 class CachedBitmap : public GdiplusBase
908 {
909-    friend Graphics;
910+    friend class Graphics;
911
912 public:
913     CachedBitmap(IN Bitmap *bitmap,
914@@ -888,7 +888,7 @@
915
916     UINT GetDownLevelRasterizationLimit() const;
917
918-    static UINT Metafile::EmfToWmfBits(
919+    static UINT EmfToWmfBits(
920         IN HENHMETAFILE       hemf,
921         IN UINT               cbData16,
922         OUT LPBYTE            pData16,
923--- include/gdiplusimageattributes.h.orig	2008-01-18 22:17:46.000000000 +0900
924+++ include/gdiplusimageattributes.h	2009-08-21 09:21:56.000000000 +0900
925@@ -32,6 +32,9 @@
926
927 #ifndef _GDIPLUSIMAGEATTRIBUTES_H
928 #define _GDIPLUSIMAGEATTRIBUTES_H
929+#if __GNUC__ >=3
930+#pragma GCC system_header
931+#endif
932
933 class GpImageAttributes;
934
935--- include/gdiplusimaging.h.orig	2008-01-18 22:17:46.000000000 +0900
936+++ include/gdiplusimaging.h	2009-08-21 09:21:56.000000000 +0900
937@@ -160,7 +160,7 @@
938     UINT Width;
939     UINT Height;
940     INT Stride;
941-    PixelFormat PixelFormat;
942+    ::Gdiplus::PixelFormat PixelFormat;
943     VOID* Scan0;
944     UINT_PTR Reserved;
945 };
946--- include/gdiplusmatrix.h.orig	2008-01-18 22:17:46.000000000 +0900
947+++ include/gdiplusmatrix.h	2009-08-21 09:21:56.000000000 +0900
948@@ -1,3 +1,6 @@
949+#if __GNUC__ >=3
950+#pragma GCC system_header
951+#endif
952 /**************************************************************************\
953 *
954 * Copyright (c) 1998-2001, Microsoft Corp.  All Rights Reserved.
955--- include/gdipluspath.h.orig	2008-01-18 22:17:46.000000000 +0900
956+++ include/gdipluspath.h	2009-08-21 09:21:56.000000000 +0900
957@@ -1,3 +1,6 @@
958+#if __GNUC__ >=3
959+#pragma GCC system_header
960+#endif
961 /**************************************************************************\
962 *
963 * Copyright (c) 1998-2001, Microsoft Corp.  All Rights Reserved.
964--- include/gdipluspen.h.orig	2008-01-18 22:17:46.000000000 +0900
965+++ include/gdipluspen.h	2009-08-21 09:21:56.000000000 +0900
966@@ -1,3 +1,6 @@
967+#if __GNUC__ >=3
968+#pragma GCC system_header
969+#endif
970 /**************************************************************************\
971 *
972 * Copyright (c) 1998-2001, Microsoft Corp.  All Rights Reserved.
973--- include/gdiplusregion.h.orig	2008-01-18 22:17:46.000000000 +0900
974+++ include/gdiplusregion.h	2009-08-21 09:21:56.000000000 +0900
975@@ -1,3 +1,6 @@
976+#if __GNUC__ >=3
977+#pragma GCC system_header
978+#endif
979 /**************************************************************************\
980 *
981 * Copyright (c) 1998-2001, Microsoft Corp.  All Rights Reserved.
982--- include/gdiplusstringformat.h.orig	2008-01-18 22:17:46.000000000 +0900
983+++ include/gdiplusstringformat.h	2009-08-21 09:21:56.000000000 +0900
984@@ -217,7 +217,7 @@
985         ));
986     }
987
988-    StringTrimming StringFormat::GetTrimming() const
989+    StringTrimming GetTrimming() const
990     {
991         StringTrimming trimming;
992         SetStatus(DllExports::GdipGetStringFormatTrimming(
993--- include/imm.h.orig	2008-01-18 22:17:20.000000000 +0900
994+++ include/imm.h	2009-08-21 09:21:56.000000000 +0900
995@@ -7,6 +7,13 @@
996 #ifndef _IMM_
997 #define _IMM_
998
999+#define __in
1000+#define __out
1001+#ifdef __cplusplus
1002+#define __inline inline
1003+#else
1004+#define __inline static __inline__
1005+#endif
1006
1007 #ifdef __cplusplus
1008 extern "C" {
1009@@ -715,5 +722,9 @@
1010 }
1011 #endif
1012
1013+#undef __in
1014+#undef __out
1015+#undef __inline
1016+
1017 #endif  // _IMM_
1018
1019--- include/imagehlp.h.orig	2008-01-18 22:17:20.000000000 +0900
1020+++ include/imagehlp.h	2009-08-21 09:21:56.000000000 +0900
1021@@ -1,3 +1,6 @@
1022+#if __GNUC__ >=3
1023+#pragma GCC system_header
1024+#endif
1025 /*++ BUILD Version: 0000     Increment this if a change has global effects
1026
1027 Copyright (c) Microsoft Corporation. All rights reserved.
1028@@ -59,6 +62,13 @@
1029 #include <wintrust.h>
1030 #endif
1031
1032+#define __in
1033+#define __out
1034+#ifdef __cplusplus
1035+#define __inline inline
1036+#else
1037+#define __inline static __inline__
1038+#endif
1039
1040 #ifdef __cplusplus
1041 extern "C" {
1042@@ -407,7 +417,7 @@
1043 IMAGEAPI
1044 TouchFileTimes (
1045     __in HANDLE FileHandle,
1046-    __in_opt PSYSTEMTIME pSystemTime
1047+    __in_opt LPSYSTEMTIME pSystemTime
1048     );
1049
1050 BOOL
1051@@ -3950,7 +3960,7 @@
1052 // ThreadId must be 4 bytes on all architectures.
1053 //
1054
1055-C_ASSERT (sizeof ( ((PPROCESS_INFORMATION)0)->dwThreadId ) == 4);
1056+//C_ASSERT (sizeof ( ((PPROCESS_INFORMATION)0)->dwThreadId ) == 4);
1057
1058 typedef struct _MINIDUMP_THREAD {
1059     ULONG32 ThreadId;
1060@@ -4684,5 +4694,9 @@
1061 #endif
1062
1063
1064+#undef __in
1065+#undef __out
1066+#undef __inline
1067+
1068 #endif // _IMAGEHLP_
1069
1070--- include/mapiwin.h.orig	2008-01-18 22:17:22.000000000 +0900
1071+++ include/mapiwin.h	2009-08-21 09:21:56.000000000 +0900
1072@@ -428,5 +428,5 @@
1073 #endif
1074
1075 #endif /* __MAPIWIN_H__ */
1076-
1077+
1078
1079--- include/msdasc.h.orig	2008-01-18 22:17:26.000000000 +0900
1080+++ include/msdasc.h	2009-08-21 09:21:56.000000000 +0900
1081@@ -1,3 +1,6 @@
1082+#if __GNUC__ >=3
1083+#pragma GCC system_header
1084+#endif
1085
1086
1087 /* this ALWAYS GENERATED file contains the definitions for the interfaces */
1088--- include/msi.h.orig	2008-01-18 22:17:28.000000000 +0900
1089+++ include/msi.h	2009-08-21 09:21:56.000000000 +0900
1090@@ -59,6 +59,14 @@
1091 #endif // _MSI_NO_CRYPTO
1092 #endif //(_WIN32_MSI >= 150)
1093
1094+#define __in
1095+#define __out
1096+#ifdef __cplusplus
1097+#define __inline inline
1098+#else
1099+#define __inline static __inline__
1100+#endif
1101+
1102 // --------------------------------------------------------------------------
1103 // Installer generic handle definitions
1104 // --------------------------------------------------------------------------
1105@@ -2248,5 +2256,9 @@
1106 // LOCALIZE END
1107
1108
1109+#undef __in
1110+#undef __out
1111+#undef __inline
1112+
1113 #endif // _MSI_H_
1114
1115--- include/msiquery.h.orig	2008-01-18 22:17:28.000000000 +0900
1116+++ include/msiquery.h	2009-08-21 09:21:56.000000000 +0900
1117@@ -21,6 +21,14 @@
1118 #define _MSIQUERY_H_
1119 #include "msi.h"  // INSTALLSTATE
1120
1121+#define __in
1122+#define __out
1123+#ifdef __cplusplus
1124+#define __inline inline
1125+#else
1126+#define __inline static __inline__
1127+#endif
1128+
1129 #define MSI_NULL_INTEGER 0x80000000  // integer value reserved for null
1130
1131 // MsiOpenDatabase persist predefine values, otherwise output database path is used
1132@@ -1026,5 +1034,9 @@
1133 }
1134 #endif
1135
1136+#undef __in
1137+#undef __out
1138+#undef __inline
1139+
1140 #endif // _MSIQUERY_H_
1141
1142--- include/multimon.h.orig	2008-01-18 22:17:30.000000000 +0900
1143+++ include/multimon.h	2009-08-21 09:21:56.000000000 +0900
1144@@ -175,7 +175,7 @@
1145
1146 BOOL IsPlatformNT()
1147 {
1148-    OSVERSIONINFOA osvi = {0};
1149+    OSVERSIONINFOA osvi;
1150     osvi.dwOSVersionInfoSize = sizeof(osvi);
1151     GetVersionExA((OSVERSIONINFOA*)&osvi);
1152     return (VER_PLATFORM_WIN32_NT == osvi.dwPlatformId);
1153--- include/ntquery.h.orig	2008-01-18 22:17:30.000000000 +0900
1154+++ include/ntquery.h	2009-02-16 21:34:39.065125000 +0900
1155@@ -1,3 +1,6 @@
1156+#if __GNUC__ >=3
1157+#pragma GCC system_header
1158+#endif
1159 //+---------------------------------------------------------------------------
1160 //
1161 //  Microsoft Windows
1162@@ -18,6 +21,14 @@
1163
1164 #include "stgprop.h"
1165
1166+#define __in
1167+#define __out
1168+#ifdef __cplusplus
1169+#define __inline inline
1170+#else
1171+#define __inline static __inline__
1172+#endif
1173+
1174 #if defined(__cplusplus)
1175 extern "C"
1176 {
1177@@ -404,6 +415,10 @@
1178 }
1179 #endif
1180
1181+#undef __in
1182+#undef __out
1183+#undef __inline
1184+
1185 #endif // __NTQUERY_H__
1186
1187
1188--- include/oaidl.h.orig	2008-12-06 11:32:03.000000000 +0900
1189+++ include/oaidl.h	2010-02-27 13:28:29.448250000 +0900
1190@@ -1,3 +1,6 @@
1191+#if __GNUC__ >=3
1192+#pragma GCC system_header
1193+#endif
1194
1195
1196 /* this ALWAYS GENERATED file contains the definitions for the interfaces */
1197@@ -442,7 +445,7 @@
1198                 FLOAT fltVal;
1199                 DOUBLE dblVal;
1200                 VARIANT_BOOL boolVal;
1201-                _VARIANT_BOOL bool;
1202+//                _VARIANT_BOOL bool;
1203                 SCODE scode;
1204                 CY cyVal;
1205                 DATE date;
1206--- include/ocidl.h.orig	2008-01-18 22:17:32.000000000 +0900
1207+++ include/ocidl.h	2009-08-21 09:21:56.000000000 +0900
1208@@ -1,3 +1,6 @@
1209+#if __GNUC__ >=3
1210+#pragma GCC system_header
1211+#endif
1212
1213
1214 /* this ALWAYS GENERATED file contains the definitions for the interfaces */
1215@@ -294,6 +297,14 @@
1216 #include "servprov.h"
1217 #include "urlmon.h"
1218
1219+#define __in
1220+#define __out
1221+#ifdef __cplusplus
1222+#define __inline inline
1223+#else
1224+#define __inline static __inline__
1225+#endif
1226+
1227 #ifdef __cplusplus
1228 extern "C"{
1229 #endif
1230@@ -4595,11 +4606,13 @@
1231 	HITRESULT_HIT	= 3
1232     } 	HITRESULT;
1233
1234+#if 0
1235 typedef /* [v1_enum] */
1236 enum tagDVASPECT2
1237     {	DVASPECT_OPAQUE	= 16,
1238 	DVASPECT_TRANSPARENT	= 32
1239     } 	DVASPECT2;
1240+#endif
1241
1242 typedef struct tagExtentInfo
1243     {
1244@@ -6554,6 +6567,10 @@
1245 }
1246 #endif
1247
1248+#undef __in
1249+#undef __out
1250+#undef __inline
1251+
1252 #endif
1253
1254
1255--- include/oleauto.h.orig	2008-01-18 22:17:32.000000000 +0900
1256+++ include/oleauto.h	2009-08-21 09:21:56.000000000 +0900
1257@@ -56,6 +56,14 @@
1258 /* pull in the MIDL generated header */
1259 #include <oaidl.h>
1260
1261+#define __in
1262+#define __out
1263+#ifdef __cplusplus
1264+#define __inline inline
1265+#else
1266+#define __inline static __inline__
1267+#endif
1268+
1269
1270 /*---------------------------------------------------------------------*/
1271 /*                            BSTR API                                 */
1272@@ -1160,7 +1168,7 @@
1273
1274 // Declare variant access functions.
1275
1276-#if __STDC__ || defined(NONAMELESSUNION)
1277+#ifdef NONAMELESSUNION
1278 #define V_UNION(X, Y)   ((X)->n1.n2.n3.Y)
1279 #define V_VT(X)         ((X)->n1.n2.vt)
1280 #define V_RECORDINFO(X) ((X)->n1.n2.n3.brecVal.pRecInfo)
1281@@ -1242,5 +1250,9 @@
1282 #include <poppack.h>
1283 #endif // RC_INVOKED
1284
1285+#undef __in
1286+#undef __out
1287+#undef __inline
1288+
1289 #endif     // __OLEAUTO_H__
1290
1291--- include/olectl.h.orig	2008-01-18 22:17:32.000000000 +0900
1292+++ include/olectl.h	2009-08-21 09:21:56.000000000 +0900
1293@@ -28,6 +28,14 @@
1294 #include <ocidl.h>
1295 #endif // _MAC
1296
1297+#define __in
1298+#define __out
1299+#ifdef __cplusplus
1300+#define __inline inline
1301+#else
1302+#define __inline static __inline__
1303+#endif
1304+
1305 #ifdef _OLEAUT32_
1306 #define WINOLECTLAPI        STDAPI
1307 #define WINOLECTLAPI_(type) STDAPI_(type)
1308@@ -616,5 +624,9 @@
1309
1310 #endif // defined(__MKTYPLIB__) || defined(__midl)
1311
1312+#undef __in
1313+#undef __out
1314+#undef __inline
1315+
1316 #endif // _OLECTL_H_
1317
1318--- include/oledb.h.orig	2008-01-18 22:17:32.000000000 +0900
1319+++ include/oledb.h	2009-08-21 09:21:56.000000000 +0900
1320@@ -1,3 +1,6 @@
1321+#if __GNUC__ >=3
1322+#pragma GCC system_header
1323+#endif
1324
1325
1326 /* this ALWAYS GENERATED file contains the definitions for the interfaces */
1327@@ -797,7 +800,7 @@
1328
1329 //@@@+ V2.0
1330 #if( OLEDBVER >= 0x0200 )
1331-#if !defined(_WINBASE_) && !defined(_FILETIME_)
1332+#if !defined(_WINBASE_H) && !defined(_FILETIME_)
1333 #define _FILETIME_
1334 typedef struct _FILETIME {
1335 		DWORD dwLowDateTime;
1336--- include/oleidl.h.orig	2008-01-18 22:17:32.000000000 +0900
1337+++ include/oleidl.h	2009-08-21 09:21:56.000000000 +0900
1338@@ -1,3 +1,6 @@
1339+#if __GNUC__ >=3
1340+#pragma GCC system_header
1341+#endif
1342
1343
1344 /* this ALWAYS GENERATED file contains the definitions for the interfaces */
1345@@ -189,6 +192,14 @@
1346 /* header files for imported files */
1347 #include "objidl.h"
1348
1349+#define __in
1350+#define __out
1351+#ifdef __cplusplus
1352+#define __inline inline
1353+#else
1354+#define __inline static __inline__
1355+#endif
1356+
1357 #ifdef __cplusplus
1358 extern "C"{
1359 #endif
1360@@ -3868,6 +3879,10 @@
1361 }
1362 #endif
1363
1364+#undef __in
1365+#undef __out
1366+#undef __inline
1367+
1368 #endif
1369
1370
1371--- include/propidl.h.orig	2008-01-18 22:17:32.000000000 +0900
1372+++ include/propidl.h	2010-02-27 14:11:52.213875000 +0900
1373@@ -1,3 +1,6 @@
1374+#if __GNUC__ >=3
1375+#pragma GCC system_header
1376+#endif
1377
1378
1379 /* this ALWAYS GENERATED file contains the definitions for the interfaces */
1380@@ -76,6 +79,14 @@
1381 #include "objidl.h"
1382 #include "oaidl.h"
1383
1384+#define __in
1385+#define __out
1386+#ifdef __cplusplus
1387+#define __inline inline
1388+#else
1389+#define __inline static __inline__
1390+#endif
1391+
1392 #ifdef __cplusplus
1393 extern "C"{
1394 #endif
1395@@ -143,6 +154,7 @@
1396     CHAR *pElems;
1397     } 	CAC;
1398
1399+#if 0
1400 typedef struct tagCAUB
1401     {
1402     ULONG cElems;
1403@@ -268,7 +280,9 @@
1404     ULONG cElems;
1405     CLSID *pElems;
1406     } 	CACLSID;
1407+#endif
1408
1409+#if 0
1410 #ifdef MIDL_PASS
1411 // This is the PROPVARIANT padding layout for marshaling.
1412 typedef BYTE PROPVAR_PAD1;
1413@@ -385,6 +399,7 @@
1414 #endif
1415
1416 #endif /* _MSC_EXTENSIONS */
1417+#endif
1418
1419 #ifdef MIDL_PASS
1420 // This is the LPPROPVARIANT definition for marshaling.
1421@@ -509,6 +524,7 @@
1422
1423 #define	PRSPEC_PROPID	( 1 )
1424
1425+#if 0
1426 typedef struct tagPROPSPEC
1427     {
1428     ULONG ulKind;
1429@@ -526,12 +542,14 @@
1430     PROPID propid;
1431     VARTYPE vt;
1432     } 	STATPROPSTG;
1433+#endif
1434
1435 // Macros for parsing the OS Version of the Property Set Header
1436 #define PROPSETHDR_OSVER_KIND(dwOSVer)      HIWORD( (dwOSVer) )
1437 #define PROPSETHDR_OSVER_MAJOR(dwOSVer)     LOBYTE(LOWORD( (dwOSVer) ))
1438 #define PROPSETHDR_OSVER_MINOR(dwOSVer)     HIBYTE(LOWORD( (dwOSVer) ))
1439 #define PROPSETHDR_OSVERSION_UNKNOWN        0xFFFFFFFF
1440+#if 0
1441 typedef struct tagSTATPROPSETSTG
1442     {
1443     FMTID fmtid;
1444@@ -542,12 +560,14 @@
1445     FILETIME atime;
1446     DWORD dwOSVersion;
1447     } 	STATPROPSETSTG;
1448+#endif
1449
1450
1451
1452 extern RPC_IF_HANDLE __MIDL_itf_propidl_0000_0000_v0_0_c_ifspec;
1453 extern RPC_IF_HANDLE __MIDL_itf_propidl_0000_0000_v0_0_s_ifspec;
1454
1455+#if 0
1456 #ifndef __IPropertyStorage_INTERFACE_DEFINED__
1457 #define __IPropertyStorage_INTERFACE_DEFINED__
1458
1459@@ -1119,7 +1139,6 @@
1460 #endif 	/* C style interface */
1461
1462
1463-
1464 /* [call_as] */ HRESULT STDMETHODCALLTYPE IEnumSTATPROPSETSTG_RemoteNext_Proxy(
1465     IEnumSTATPROPSETSTG * This,
1466     /* [in] */ ULONG celt,
1467@@ -1136,6 +1155,7 @@
1468
1469
1470 #endif 	/* __IEnumSTATPROPSETSTG_INTERFACE_DEFINED__ */
1471+#endif
1472
1473
1474 /* interface __MIDL_itf_propidl_0000_0004 */
1475@@ -1268,6 +1287,10 @@
1476 }
1477 #endif
1478
1479+#undef __in
1480+#undef __out
1481+#undef __inline
1482+
1483 #endif
1484
1485
1486--- include/propkeydef.h.orig	2008-01-18 22:17:32.000000000 +0900
1487+++ include/propkeydef.h	2009-08-21 09:21:56.000000000 +0900
1488@@ -2,6 +2,10 @@
1489 #define PID_FIRST_USABLE 2
1490 #endif
1491
1492+#ifndef __MIDL_CONST
1493+#define __MIDL_CONST const
1494+#endif
1495+
1496 #ifndef REFPROPERTYKEY
1497 #ifdef __cplusplus
1498 #define REFPROPERTYKEY const PROPERTYKEY &
1499--- include/propsys.h.orig	2008-01-18 22:17:34.000000000 +0900
1500+++ include/propsys.h	2009-08-21 09:21:56.000000000 +0900
1501@@ -228,6 +228,14 @@
1502 #endif // 0
1503 #include <propkeydef.h>
1504
1505+#define __in
1506+#define __out
1507+#ifdef __cplusplus
1508+#define __inline inline
1509+#else
1510+#define __inline static __inline__
1511+#endif
1512+
1513
1514 extern RPC_IF_HANDLE __MIDL_itf_propsys_0000_0000_v0_0_c_ifspec;
1515 extern RPC_IF_HANDLE __MIDL_itf_propsys_0000_0000_v0_0_s_ifspec;
1516@@ -3600,6 +3608,10 @@
1517 }
1518 #endif
1519
1520+#undef __in
1521+#undef __out
1522+#undef __inline
1523+
1524 #endif
1525
1526
1527--- include/propvarutil.h.orig	2008-01-18 22:17:34.000000000 +0900
1528+++ include/propvarutil.h	2010-02-26 19:34:40.863625000 +0900
1529@@ -14,6 +14,14 @@
1530 #include <shtypes.h>
1531 #include <shlwapi.h>
1532
1533+#define __in
1534+#define __out
1535+#ifdef __cplusplus
1536+#define __inline inline
1537+#else
1538+#define __inline static __inline__
1539+#endif
1540+
1541 #ifndef PSSTDAPI
1542 #if defined(_PROPSYS_)
1543 #define PSSTDAPI          STDAPI
1544--- include/shlobj.h.orig	2008-01-18 22:17:36.000000000 +0900
1545+++ include/shlobj.h	2009-08-21 09:21:56.000000000 +0900
1546@@ -1,3 +1,6 @@
1547+#if __GNUC__ >=3
1548+#pragma GCC system_header
1549+#endif
1550 /*===========================================================================
1551
1552 Copyright (c) Microsoft Corporation. All rights reserved.
1553@@ -103,6 +106,14 @@
1554 #include <shtypes.h>
1555 #include <shobjidl.h>
1556
1557+#define __in
1558+#define __out
1559+#ifdef __cplusplus
1560+#define __inline inline
1561+#else
1562+#define __inline static __inline__
1563+#endif
1564+
1565 #if defined(_MSC_VER) && (_MSC_VER >= 1200)
1566 #pragma once
1567 #endif
1568@@ -3117,7 +3128,7 @@
1569 SHSTDAPI_(BOOL)                 ILIsEqual(__in PCIDLIST_ABSOLUTE pidl1, __in PCIDLIST_ABSOLUTE pidl2);
1570 SHSTDAPI_(BOOL)                 ILIsParent(__in PCIDLIST_ABSOLUTE pidl1, __in PCIDLIST_ABSOLUTE pidl2, BOOL fImmediate);
1571 SHSTDAPI                        ILSaveToStream(__in IStream *pstm, __in PCUIDLIST_RELATIVE pidl);
1572-DECLSPEC_DEPRECATED SHSTDAPI    ILLoadFromStream(__in IStream *pstm, __inout PIDLIST_RELATIVE *pidl);
1573+SHSTDAPI    ILLoadFromStream(__in IStream *pstm, __inout PIDLIST_RELATIVE *pidl);
1574 SHSTDAPI                        ILLoadFromStreamEx(__in IStream *pstm, __deref_out PIDLIST_RELATIVE *pidl);
1575
1576 #if (_WIN32_IE >= 0x0400)
1577@@ -4578,5 +4589,9 @@
1578 #endif
1579 #endif
1580
1581+#undef __in
1582+#undef __out
1583+#undef __inline
1584+
1585 #endif /* _SHLOBJ_H_ */
1586
1587--- include/shobjidl.h.orig	2008-01-18 22:17:36.000000000 +0900
1588+++ include/shobjidl.h	2009-08-21 09:21:56.000000000 +0900
1589@@ -1,3 +1,6 @@
1590+#if __GNUC__ >=3
1591+#pragma GCC system_header
1592+#endif
1593
1594
1595 /* this ALWAYS GENERATED file contains the definitions for the interfaces */
1596@@ -1667,6 +1670,14 @@
1597 #include "prsht.h"
1598 #include "propsys.h"
1599
1600+#define __in
1601+#define __out
1602+#ifdef __cplusplus
1603+#define __inline inline
1604+#else
1605+#define __inline static __inline__
1606+#endif
1607+
1608 #ifdef __cplusplus
1609 extern "C"{
1610 #endif
1611@@ -6384,7 +6395,6 @@
1612
1613 typedef ICommDlgBrowser2 *LPCOMMDLGBROWSER2;
1614
1615-#endif  // NTDDI_WIN2K
1616 #if (_WIN32_IE >= _WIN32_IE_IE70)
1617
1618
1619@@ -6727,6 +6737,7 @@
1620 /* [local] */
1621
1622 #endif  // (_WIN32_IE >= _WIN32_IE_IE70)
1623+#endif  // NTDDI_WIN2K
1624
1625
1626 extern RPC_IF_HANDLE __MIDL_itf_shobjidl_0000_0026_v0_0_c_ifspec;
1627@@ -7331,6 +7342,13 @@
1628 typedef LPTBBUTTON LPTBBUTTONSB;
1629 #endif //_NEVER_
1630
1631+#define __in
1632+#define __out
1633+#ifdef __cplusplus
1634+#define __inline inline
1635+#else
1636+#define __inline static __inline__
1637+#endif
1638
1639 extern RPC_IF_HANDLE __MIDL_itf_shobjidl_0000_0032_v0_0_c_ifspec;
1640 extern RPC_IF_HANDLE __MIDL_itf_shobjidl_0000_0032_v0_0_s_ifspec;
1641@@ -29000,6 +29018,10 @@
1642 }
1643 #endif
1644
1645+#undef __in
1646+#undef __out
1647+#undef __inline
1648+
1649 #endif
1650
1651
1652--- include/shtypes.h.orig	2008-01-18 22:17:36.000000000 +0900
1653+++ include/shtypes.h	2009-08-21 09:21:56.000000000 +0900
1654@@ -1,3 +1,6 @@
1655+#if __GNUC__ >=3
1656+#pragma GCC system_header
1657+#endif
1658
1659
1660 /* this ALWAYS GENERATED file contains the definitions for the interfaces */
1661@@ -137,7 +140,7 @@
1662
1663 #endif // defined(STRICT_TYPED_ITEMIDS) && defined(__cplusplus)
1664 #include <poppack.h>
1665-typedef /* [unique] */  __RPC_unique_pointer BYTE_BLOB *wirePIDL;
1666+//typedef /* [unique] */  __RPC_unique_pointer BYTE_BLOB *wirePIDL;
1667
1668 typedef /* [wire_marshal] */ ITEMIDLIST __unaligned *LPITEMIDLIST;
1669
1670--- include/sspi.h.orig	2008-01-18 22:17:38.000000000 +0900
1671+++ include/sspi.h	2009-08-21 09:21:56.000000000 +0900
1672@@ -20,6 +20,14 @@
1673 #define __SSPI_H__
1674 // end_ntifs
1675
1676+#define __in
1677+#define __out
1678+#ifdef __cplusplus
1679+#define __inline inline
1680+#else
1681+#define __inline static __inline__
1682+#endif
1683+
1684 #if _MSC_VER > 1000
1685 #pragma once
1686 #endif
1687@@ -2154,8 +2162,7 @@
1688
1689 // begin_ntifs
1690
1691-#ifndef _AUTH_IDENTITY_DEFINED
1692-#define _AUTH_IDENTITY_DEFINED
1693+#ifndef SEC_WINNT_AUTH_IDENTITY_ANSI
1694
1695 //
1696 // This was not defined in NTIFS.h for windows 2000 however
1697@@ -2326,6 +2333,10 @@
1698 }  // extern "C"
1699 #endif
1700
1701+#undef __in
1702+#undef __out
1703+#undef __inline
1704+
1705 // begin_ntifs
1706 #endif // __SSPI_H__
1707 // end_ntifs
1708--- include/strmif.h.orig	2008-01-18 22:17:38.000000000 +0900
1709+++ include/strmif.h	2009-02-16 21:34:39.065125000 +0900
1710@@ -1,3 +1,6 @@
1711+#if __GNUC__ >=3
1712+#pragma GCC system_header
1713+#endif
1714
1715
1716 /* this ALWAYS GENERATED file contains the definitions for the interfaces */
1717@@ -888,6 +891,14 @@
1718 #include "oaidl.h"
1719 #include "ocidl.h"
1720
1721+#define __in
1722+#define __out
1723+#ifdef __cplusplus
1724+#define __inline inline
1725+#else
1726+#define __inline static __inline__
1727+#endif
1728+
1729 #ifdef __cplusplus
1730 extern "C"{
1731 #endif
1732@@ -16250,7 +16261,7 @@
1733 #define _IAMFilterGraphCallback_
1734 // Note: Because this interface was not defined as a proper interface it is
1735 //       supported under C++ only. Methods aren't stdcall.
1736-EXTERN_GUID(IID_IAMFilterGraphCallback,0x56a868fd,0x0ad4,0x11ce,0xb0,0xa3,0x0,0x20,0xaf,0x0b,0xa7,0x70);
1737+DEFINE_GUID(IID_IAMFilterGraphCallback,0x56a868fd,0x0ad4,0x11ce,0xb0,0xa3,0x0,0x20,0xaf,0x0b,0xa7,0x70);
1738 interface IAMFilterGraphCallback : public IUnknown
1739 {
1740     // S_OK means rendering complete, S_FALSE means retry now.
1741@@ -21934,7 +21945,7 @@
1742 typedef struct tagVMRGUID
1743     {
1744     GUID *pGUID;
1745-    GUID GUID;
1746+    GUID aGUID;
1747     } 	VMRGUID;
1748
1749 typedef struct tagVMRMONITORINFO
1750@@ -23341,6 +23352,10 @@
1751 }
1752 #endif
1753
1754+#undef __in
1755+#undef __out
1756+#undef __inline
1757+
1758 #endif
1759
1760
1761--- include/strsafe.h.orig	2008-01-18 22:17:38.000000000 +0900
1762+++ include/strsafe.h	2009-02-16 21:34:39.065125000 +0900
1763@@ -13,12 +13,23 @@
1764 #if (_MSC_VER > 1000)
1765 #pragma once
1766 #endif
1767+#if __GNUC__ >=3
1768+#pragma GCC system_header
1769+#endif
1770
1771 #include <stdio.h>          // for _vsnprintf, _vsnwprintf, getc, getwc
1772 #include <string.h>         // for memset
1773 #include <stdarg.h>         // for va_start, etc.
1774 #include <specstrings.h>    // for __in, etc.
1775
1776+#define __in
1777+#define __out
1778+#ifdef __cplusplus
1779+#define __inline inline
1780+#else
1781+#define __inline static __inline__
1782+#endif
1783+
1784 #if !defined(_W64)
1785 #if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && (_MSC_VER >= 1300)
1786 #define _W64 __w64
1787@@ -9254,7 +9265,7 @@
1788             wchar_t ch = getwc(stdin);
1789             // ASSERT(sizeof(wchar_t) == sizeof(wint_t));
1790
1791-            if (ch == WEOF)
1792+            if (ch == 0xffff)
1793             {
1794                 if (cchNewDestLength == 0)
1795                 {
1796@@ -9763,5 +9774,9 @@
1797
1798 #pragma warning(pop)
1799
1800+#undef __in
1801+#undef __out
1802+#undef __inline
1803+
1804 #endif  // _STRSAFE_H_INCLUDED_
1805
1806--- include/structuredquery.h.orig	2008-01-18 22:17:38.000000000 +0900
1807+++ include/structuredquery.h	2009-08-21 09:21:56.000000000 +0900
1808@@ -233,6 +233,14 @@
1809 #include "ocidl.h"
1810 #include "propidl.h"
1811
1812+#define __in
1813+#define __out
1814+#ifdef __cplusplus
1815+#define __inline inline
1816+#else
1817+#define __inline static __inline__
1818+#endif
1819+
1820 #ifdef __cplusplus
1821 extern "C"{
1822 #endif
1823@@ -2472,6 +2480,10 @@
1824 }
1825 #endif
1826
1827+#undef __in
1828+#undef __out
1829+#undef __inline
1830+
1831 #endif
1832
1833
1834--- include/urlmon.h.orig	2008-01-18 22:17:40.000000000 +0900
1835+++ include/urlmon.h	2009-08-21 09:21:56.000000000 +0900
1836@@ -1,3 +1,6 @@
1837+#if __GNUC__ >=3
1838+#pragma GCC system_header
1839+#endif
1840
1841
1842 /* this ALWAYS GENERATED file contains the definitions for the interfaces */
1843@@ -330,6 +333,14 @@
1844 #include "servprov.h"
1845 #include "msxml.h"
1846
1847+#define __in
1848+#define __out
1849+#ifdef __cplusplus
1850+#define __inline inline
1851+#else
1852+#define __inline static __inline__
1853+#endif
1854+
1855 #ifdef __cplusplus
1856 extern "C"{
1857 #endif
1858@@ -8880,6 +8891,10 @@
1859 }
1860 #endif
1861
1862+#undef __in
1863+#undef __out
1864+#undef __inline
1865+
1866 #endif
1867
1868
1869--- include/wincrypt.h.orig	2008-01-18 22:17:42.000000000 +0900
1870+++ include/wincrypt.h	2009-02-16 21:34:39.065125000 +0900
1871@@ -14,6 +14,14 @@
1872
1873 #include <specstrings.h>        /* for SAL annotations */
1874
1875+#define __in
1876+#define __out
1877+#ifdef __cplusplus
1878+#define __inline inline
1879+#else
1880+#define __inline static __inline__
1881+#endif
1882+
1883 #if defined (_MSC_VER)
1884
1885 #if ( _MSC_VER >= 800 )
1886@@ -1927,6 +1935,14 @@
1887 #include <bcrypt.h>
1888 #include <ncrypt.h>
1889
1890+#define __in
1891+#define __out
1892+#ifdef __cplusplus
1893+#define __inline inline
1894+#else
1895+#define __inline static __inline__
1896+#endif
1897+
1898 // This type is used when the API can take either the CAPI1 HCRYPTPROV or
1899 // the CNG NCRYPT_KEY_HANDLE. Where appropriate, the HCRYPTPROV will be
1900 // converted to a NCRYPT_KEY_HANDLE via the CNG NCryptTranslateHandle().
1901@@ -17113,8 +17129,8 @@
1902     __in      DWORD                       dwFlags,
1903     __in_opt  PCRYPT_KEY_PROV_INFO        pKeyProvInfo,
1904     __in_opt  PCRYPT_ALGORITHM_IDENTIFIER pSignatureAlgorithm,
1905-    __in_opt  PSYSTEMTIME                 pStartTime,
1906-    __in_opt  PSYSTEMTIME                 pEndTime,
1907+    __in_opt  LPSYSTEMTIME                 pStartTime,
1908+    __in_opt  LPSYSTEMTIME                 pEndTime,
1909     __in_opt  PCERT_EXTENSIONS            pExtensions
1910     );
1911
1912@@ -19174,6 +19190,10 @@
1913 #endif
1914 #endif
1915
1916+#undef __in
1917+#undef __out
1918+#undef __inline
1919+
1920 #endif // __WINCRYPT_H__
1921
1922
1923--- include/winerror.h.orig	2008-01-18 22:17:42.000000000 +0900
1924+++ include/winerror.h	2009-08-21 09:21:56.000000000 +0900
1925@@ -23,6 +23,11 @@
1926
1927 #include <specstrings.h>
1928
1929+#ifdef __cplusplus
1930+#define __inline inline
1931+#else
1932+#define __inline static __inline__
1933+#endif
1934 //
1935 //  Values are 32 bit values laid out as follows:
1936 //
1937--- include/wingdi.h.orig	2008-01-18 22:17:42.000000000 +0900
1938+++ include/wingdi.h	2009-08-21 09:21:56.000000000 +0900
1939@@ -9,6 +9,13 @@
1940 #ifndef _WINGDI_
1941 #define _WINGDI_
1942
1943+#define __in
1944+#define __out
1945+#ifdef __cplusplus
1946+#define __inline inline
1947+#else
1948+#define __inline static __inline__
1949+#endif
1950
1951 #pragma once
1952
1953@@ -1901,7 +1908,7 @@
1954 /* size of a form name string */
1955 #define CCHFORMNAME 32
1956
1957-#if (_WIN32_WINNT >= ((OSVER(NTDDI_WINXPSP2)) >> 16))
1958+#if (_WIN32_WINNT >= ((NTDDI_WINXPSP2 & 0xFFFF0000) >> 16))
1959 typedef struct _devicemodeA {
1960     BYTE   dmDeviceName[CCHDEVICENAME];
1961     WORD dmSpecVersion;
1962@@ -5424,6 +5431,10 @@
1963 }
1964 #endif
1965
1966+#undef __in
1967+#undef __out
1968+#undef __inline
1969+
1970 #endif /* _WINGDI_ */
1971
1972
1973--- include/wintrust.h.orig	2008-01-18 22:17:42.000000000 +0900
1974+++ include/wintrust.h	2009-08-21 09:21:56.000000000 +0900
1975@@ -1252,6 +1252,7 @@
1976 //
1977 #ifdef WT_DEFINE_ALL_APIS
1978
1979+#if 0
1980 typedef struct _WIN_CERTIFICATE
1981 {
1982     DWORD       dwLength;
1983@@ -1260,6 +1261,7 @@
1984     BYTE        bCertificate[ANYSIZE_ARRAY];
1985
1986 } WIN_CERTIFICATE, *LPWIN_CERTIFICATE;
1987+#endif
1988
1989 #define WIN_CERT_REVISION_1_0               (0x0100)
1990 #define WIN_CERT_REVISION_2_0               (0x0200)
1991--- include/winuser.h.orig	2008-01-18 22:17:44.000000000 +0900
1992+++ include/winuser.h	2009-08-21 09:21:56.000000000 +0900
1993@@ -11,6 +11,15 @@
1994 #ifndef _WINUSER_
1995 #define _WINUSER_
1996
1997+#define __in
1998+#define __out
1999+#ifdef __cplusplus
2000+#define __inline inline
2001+#else
2002+#define __inline static __inline__
2003+#endif
2004+DECLARE_HANDLE(HHOOK);
2005+typedef CONST GUID *LPCGUID;
2006
2007
2008 #pragma once
2009@@ -39,7 +48,7 @@
2010 #define WINVER  0x0500      /* version 5.0 */
2011 #endif /* !WINVER */
2012
2013-#include <stdarg.h>
2014+#include <../include/stdarg.h>
2015
2016 #ifndef NOUSER
2017
2018@@ -10717,7 +10726,7 @@
2019 #define CDS_RESET                    0x40000000
2020 #define CDS_NORESET                  0x10000000
2021
2022-#include <tvout.h>
2023+//#include <tvout.h>
2024
2025 /* Return values for ChangeDisplaySettings */
2026 #define DISP_CHANGE_SUCCESSFUL       0
2027@@ -12571,16 +12580,20 @@
2028
2029
2030
2031-#if !defined(RC_INVOKED) /* RC complains about long symbols in #ifs */
2032-#if defined(ISOLATION_AWARE_ENABLED) && (ISOLATION_AWARE_ENABLED != 0)
2033-#include "winuser.inl"
2034-#endif /* ISOLATION_AWARE_ENABLED */
2035-#endif /* RC */
2036+//#if !defined(RC_INVOKED) /* RC complains about long symbols in #ifs */
2037+//#if defined(ISOLATION_AWARE_ENABLED) && (ISOLATION_AWARE_ENABLED != 0)
2038+//#include "winuser.inl"
2039+//#endif /* ISOLATION_AWARE_ENABLED */
2040+//#endif /* RC */
2041
2042 #ifdef __cplusplus
2043 }
2044 #endif  /* __cplusplus */
2045
2046+#undef __in
2047+#undef __out
2048+#undef __inline
2049+
2050 #endif /* !_WINUSER_ */
2051
2052
2053--- include/wspiapi.h.orig	2008-01-18 22:17:44.000000000 +0900
2054+++ include/wspiapi.h	2009-08-21 09:21:56.000000000 +0900
2055@@ -15,6 +15,9 @@
2056
2057 #ifndef _WSPIAPI_H_
2058 #define _WSPIAPI_H_
2059+#if __GNUC__ >=3
2060+#pragma GCC system_header
2061+#endif
2062
2063 #pragma once
2064
2065@@ -85,6 +88,11 @@
2066
2067 #ifdef __cplusplus
2068 extern "C" {
2069+#define _inline inline
2070+#define __inline inline
2071+#else
2072+#define _inline static __inline__
2073+#define __inline static __inline__
2074 #endif
2075
2076 ////////////////////////////////////////////////////////////
2077@@ -1052,6 +1060,8 @@
2078     (*pfFreeAddrInfo)(ai);
2079 }
2080
2081+#undef _inline
2082+#undef __inline
2083 #ifdef  __cplusplus
2084 }
2085 #endif
2086--- include/d3dtypes.h.orig	2004-09-27 12:34:16.000000000 +0900
2087+++ include/d3dtypes.h	2007-11-30 21:42:09.558750000 +0900
2088@@ -1,3 +1,6 @@
2089+#if __GNUC__ >=3
2090+#pragma GCC system_header
2091+#endif
2092 /*==========================================================================;
2093  *
2094  *  Copyright (C) Microsoft Corporation.  All Rights Reserved.
2095--- include/d3dx9core.h.orig	2006-03-31 12:16:02.000000000 +0900
2096+++ include/d3dx9core.h	2009-08-21 09:21:56.000000000 +0900
2097@@ -1,3 +1,6 @@
2098+#if __GNUC__ >=3
2099+#pragma GCC system_header
2100+#endif
2101 ///////////////////////////////////////////////////////////////////////////
2102 //
2103 //  Copyright (C) Microsoft Corporation.  All Rights Reserved.
2104--- include/d3dx9math.h.orig	2005-07-22 17:00:18.000000000 +0900
2105+++ include/d3dx9math.h	2009-08-21 09:21:56.000000000 +0900
2106@@ -1,3 +1,6 @@
2107+#if __GNUC__ >=3
2108+#pragma GCC system_header
2109+#endif
2110 //////////////////////////////////////////////////////////////////////////////
2111 //
2112 //  Copyright (C) Microsoft Corporation.  All Rights Reserved.
2113--- include/d3dx9math.inl.orig	2005-03-18 17:26:56.000000000 +0900
2114+++ include/d3dx9math.inl	2009-08-21 09:21:56.000000000 +0900
2115@@ -1,3 +1,6 @@
2116+#if __GNUC__ >=3
2117+#pragma GCC system_header
2118+#endif
2119 //////////////////////////////////////////////////////////////////////////////
2120 //
2121 //  Copyright (C) Microsoft Corporation.  All Rights Reserved.
2122--- include/dxtrans.h.orig	2004-09-28 00:18:32.000000000 +0900
2123+++ include/dxtrans.h	2007-01-02 22:08:41.640625000 +0900
2124@@ -1,3 +1,6 @@
2125+#if __GNUC__ >=3
2126+#pragma GCC system_header
2127+#endif
2128
2129 #pragma warning( disable: 4049 )  /* more than 64k source lines */
2130
2131