io-layer.h: Windows: Rename GetProcessId to __GetProcessId for targets not supporting...
authorKornél Pál <kornelpal@gmail.com>
Sat, 22 Mar 2008 12:25:01 +0000 (12:25 -0000)
committerKornél Pál <kornelpal@gmail.com>
Sat, 22 Mar 2008 12:25:01 +0000 (12:25 -0000)
svn path=/trunk/mono/; revision=98792

mono/io-layer/ChangeLog
mono/io-layer/io-layer.h

index 112df250a0b1295b15b199fbcdcc839dbd86e998..d373cf70f38e2790626498c7d885efd252495eca 100644 (file)
@@ -1,3 +1,9 @@
+2008-03-22  Kornél Pál  <kornelpal@gmail.com>
+
+       * io-layer.h: Windows: Rename GetProcessId to __GetProcessId for targets not
+       supporting it. This fixes MSVC build with new Windows SDKs that declare
+       GetProcessId unconditionally.
+
 2008-03-20  Kornél Pál  <kornelpal@gmail.com>
 
        * io-layer.h: Removed Windows version macros.
index 3270eda4b32c1830e7934c583e556ac9725b5c54..4776f8d4b1e875b84d8fddf264137641aa5689bd 100644 (file)
 #if defined(__WIN32__)
 /* Native win32 */
 #define __USE_W32_SOCKETS
+#if (_WIN32_WINNT < 0x0502)
+/* GetProcessId is available on Windows XP SP1 and later.
+ * Windows SDK declares it unconditionally.
+ * MinGW declares for Windows XP and later.
+ * Declare as __GetProcessId for unsupported targets. */
+#define GetProcessId __GetProcessId
+#endif
 #include <winsock2.h>
 #include <windows.h>
 #include <winbase.h>
 #include <psapi.h>
 #include <shlobj.h>
 #include <mswsock.h>
+#if (_WIN32_WINNT < 0x0502)
+#undef GetProcessId
+#endif
 #ifndef HAVE_GETPROCESSID
 #ifdef _MSC_VER
 #include <winternl.h>
 #ifndef NT_SUCCESS
-#define NT_SUCCESS (status) ((NTSTATUS) (status) >= 0)
+#define NT_SUCCESS(status) ((NTSTATUS) (status) >= 0)
 #endif /* !NT_SUCCESS */
 #else /* !_MSC_VER */
 #include <ddk/ntddk.h>