undo change in mini.c
[mono-project.git] / mono / utils / w32api.h
blob25fb3ac980f5b27406d5f7e6b1dd1b1936646e56
1 /**
2 * \file
3 */
5 #ifndef __MONO_UTILS_W32API_H__
6 #define __MONO_UTILS_W32API_H__
8 #include <glib.h>
10 #define WAIT_TOO_MANY_POSTS ((gint) 0x0000012A)
11 #define WAIT_NOT_OWNED_BY_CALLER ((gint) 0x0000012B)
13 #ifndef HOST_WIN32
15 #define WAIT_FAILED ((gint) 0xFFFFFFFF)
16 #define WAIT_OBJECT_0 ((gint) 0x00000000)
17 #define WAIT_ABANDONED_0 ((gint) 0x00000080)
18 #define WAIT_TIMEOUT ((gint) 0x00000102)
19 #define WAIT_IO_COMPLETION ((gint) 0x000000C0)
21 #define WINAPI
23 typedef guint32 DWORD;
24 typedef gboolean BOOL;
25 typedef gint32 LONG;
26 typedef guint32 ULONG;
27 typedef guint UINT;
29 typedef gpointer HANDLE;
30 typedef gpointer HMODULE;
32 #else
34 #define __USE_W32_SOCKETS
35 #include <winsock2.h>
36 #include <windows.h>
37 #include <winbase.h>
38 /* The mingw version says: /usr/i686-pc-mingw32/sys-root/mingw/include/ws2tcpip.h:38:2: error: #error "ws2tcpip.h is not compatible with winsock.h. Include winsock2.h instead." */
39 #ifdef _MSC_VER
40 #include <ws2tcpip.h>
41 #endif
42 #include <psapi.h>
44 /* Workaround for missing WSAPOLLFD typedef in mingw's winsock2.h
45 * that is required for mswsock.h below. Remove once
46 * http://sourceforge.net/p/mingw/bugs/1980/ is fixed. */
47 #if defined(__MINGW_MAJOR_VERSION) && __MINGW_MAJOR_VERSION == 4
48 typedef struct pollfd {
49 SOCKET fd;
50 short events;
51 short revents;
52 } WSAPOLLFD, *PWSAPOLLFD, *LPWSAPOLLFD;
53 #endif
55 #if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT | HAVE_UWP_WINAPI_SUPPORT)
56 #include <mswsock.h>
57 #endif
59 #endif /* HOST_WIN32 */
61 #endif /* __MONO_UTILS_W32API_H__ */