Merge pull request #1656 from alexanderkyte/webservice_27561
[mono.git] / mono / io-layer / io-layer.h
1 /*
2  * io-layer.h: Include the right files depending on platform.  This
3  * file is the only entry point into the io-layer library.
4  *
5  * Author:
6  *      Dick Porter (dick@ximian.com)
7  *
8  * (C) 2002 Ximian, Inc.
9  */
10
11 #ifndef _MONO_IOLAYER_IOLAYER_H_
12 #define _MONO_IOLAYER_IOLAYER_H_
13
14 #if defined(__WIN32__) || defined(_WIN32)
15 /* Native win32 */
16 #define __USE_W32_SOCKETS
17 #include <winsock2.h>
18 #include <windows.h>
19 #include <winbase.h>
20 /*
21  * The mingw version says:
22  * /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."
23  */
24 #ifdef _MSC_VER
25 #include <ws2tcpip.h>
26 #endif
27 #include <psapi.h>
28 #include <shlobj.h>
29 /*
30  * Workaround for missing WSAPOLLFD typedef in mingw's winsock2.h that is required for mswsock.h below.
31  * Remove once http://sourceforge.net/p/mingw/bugs/1980/ is fixed.
32  */
33 #if defined(__MINGW_MAJOR_VERSION) && __MINGW_MAJOR_VERSION == 4 
34 typedef struct pollfd {
35   SOCKET fd;
36   short  events;
37   short  revents;
38 } WSAPOLLFD, *PWSAPOLLFD, *LPWSAPOLLFD;
39 #endif
40 #include <mswsock.h>
41 #else   /* EVERYONE ELSE */
42 #include "mono/io-layer/wapi.h"
43 #include "mono/io-layer/uglify.h"
44 #endif /* HOST_WIN32 */
45
46 #ifdef __native_client__
47 #include "mono/metadata/nacl-stub.h"
48 #endif
49
50 #endif /* _MONO_IOLAYER_IOLAYER_H_ */