3 * Watt-32 API decoration for Win32 targets.
8 #if !defined(_WATT32_FAKE_WINSOCK_H) && (defined(_WINSOCK_H) || defined(_WINSOCKAPI_))
9 #error Never include the real <winsock.h> in Watt-32 programs.
10 #error Change your include-path so the fake <winsock.h> gets included first.
13 #if !defined(_WATT32_FAKE_WINSOCK2_H) && (defined(_WINSOCK2_H) || defined(_WINSOCK2API_))
14 #error Never include the real <winsock2.h> in Watt-32 programs.
15 #error Change your include-path so the fake <winsock2.h> gets included first.
18 #if !defined(_WATT32_FAKE_WS2TCPIP_H) && defined(_WS2TCPIP_H)
19 #error Never include the real <ws2tcpip.h> in Watt-32 programs.
20 #error Change your include-path so the fake <ws2tcpip.h> gets included first.
23 #if defined(WIN32) || defined(_WIN32)
24 /* Don't include the real <winsock*.h> */
29 #ifndef WIN32_LEAN_AND_MEAN
30 #define WIN32_LEAN_AND_MEAN
36 * For non-Win32 targets the .\util\mkimp program (a small C-preprocessor)
37 * is meant to search all headers for W32_FUNC/W32_DATA prefixes. All
38 * functions with a W32_FUNC prefix will produce an export stub function.
39 * See dj_dxe.mak. Very experimental at the moment.
41 * Note: only a small subset of the Winsock extensions are implemented in
42 * watt-32.dll (hardly any WSA*() functions yet).
44 #if (defined(WIN32) || defined(_WIN32)) && !defined(WATT32_STATIC)
45 #if defined(WATT32_BUILD)
46 #define W32_FUNC extern __declspec(dllexport)
47 #define W32_DATA extern __declspec(dllexport)
49 #define W32_FUNC extern __declspec(dllimport)
50 #define W32_DATA extern __declspec(dllimport)
53 #define W32_FUNC extern
54 #define W32_DATA extern
58 * W32_CALL is *not* defined to `stdcall' due to a bug in MingW's
59 * linker. This bug prevents a MingW generated WATT-32.DLL from
60 * being used by e.g. a MSVC program.
61 * Ref. http://sources.redhat.com/bugzilla/show_bug.cgi?id=351
64 #if (defined(WIN32) || defined(_WIN32)) && 0
65 #define W32_CALL __stdcall /* maybe __fastcall instead for MSVC? */