Skip to content

Commit

Permalink
io-layer.h: Windows: Rename GetProcessId to __GetProcessId for target…
Browse files Browse the repository at this point in the history
…s not supporting it. This fixes MSVC build with new Windows SDKs that declare GetProcessId unconditionally.

svn path=/trunk/mono/; revision=98792
  • Loading branch information
kornelpal committed Mar 22, 2008
1 parent 054aa01 commit ef24b32
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
6 changes: 6 additions & 0 deletions mono/io-layer/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
2008-03-22 Kornél Pál <[email protected]>

* 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 <[email protected]>

* io-layer.h: Removed Windows version macros.
Expand Down
12 changes: 11 additions & 1 deletion mono/io-layer/io-layer.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,28 @@
#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 <ws2tcpip.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>
Expand Down

0 comments on commit ef24b32

Please sign in to comment.