[interp] Remove unreachable code (#12411)
[mono-project.git] / mono / utils / w32api.h
blobe7a0ce4c4ccfa13498da470fa002dd9d9f7af361
1 /**
2 * \file
3 */
5 #ifndef __MONO_UTILS_W32API_H__
6 #define __MONO_UTILS_W32API_H__
8 #include <glib.h>
10 #ifndef HOST_WIN32
12 #define WAIT_FAILED ((gint) 0xFFFFFFFF)
13 #define WAIT_OBJECT_0 ((gint) 0x00000000)
14 #define WAIT_ABANDONED_0 ((gint) 0x00000080)
15 #define WAIT_TIMEOUT ((gint) 0x00000102)
16 #define WAIT_IO_COMPLETION ((gint) 0x000000C0)
18 #define WINAPI
20 typedef guint32 DWORD;
21 typedef gboolean BOOL;
22 typedef gint32 LONG;
23 typedef guint32 ULONG;
24 typedef guint UINT;
26 typedef gpointer HANDLE;
27 typedef gpointer HMODULE;
29 #else
31 #define __USE_W32_SOCKETS
32 #include <winsock2.h>
33 #include <windows.h>
34 #include <winbase.h>
35 /* 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." */
36 #ifdef _MSC_VER
37 #include <ws2tcpip.h>
38 #endif
39 #include <psapi.h>
41 /* Workaround for missing WSAPOLLFD typedef in mingw's winsock2.h
42 * that is required for mswsock.h below. Remove once
43 * http://sourceforge.net/p/mingw/bugs/1980/ is fixed. */
44 #if defined(__MINGW_MAJOR_VERSION) && __MINGW_MAJOR_VERSION == 4
45 typedef struct pollfd {
46 SOCKET fd;
47 short events;
48 short revents;
49 } WSAPOLLFD, *PWSAPOLLFD, *LPWSAPOLLFD;
50 #endif
52 #if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT | HAVE_UWP_WINAPI_SUPPORT)
53 #include <mswsock.h>
54 #endif
56 #endif /* HOST_WIN32 */
58 #endif /* __MONO_UTILS_W32API_H__ */