Code

Added src/libconfig so distribution
[collectd.git] / src / libconfig / win32.h
1 #if !defined(_LOCAL_WIN32_H) && defined(__WIN32__) && !defined(__CYGWIN__)
2 #define _LOCAL_WIN32_H
4 #ifdef HAVE_CONFIG_H
5 #include "config.h"
6 #endif
8 #ifdef __MINGW32__
9      /* MingW32 specific stuff here. */
10 #  if defined(HAVE_WINSOCK2_H) && defined(HAVE_LIBWSOCK32)
11      /* We have to override the detected configuration
12         because it can't detect the network libraries. */
13 #    define HAVE_GETHOSTBYNAME 1
14 #    define HAVE_INET_ADDR 1
15 #    define HAVE_SOCKET 1
16 #  endif
17 #  define sleep(x) Sleep((x) * 1000)
18 #else
19    /* MSVC++ configuration follows */
20 #  undef HAVE_UNISTD_H
21 #  define HAVE_STDLIB_H 1
22 #  define HAVE_WINDOWS_H 1
23 #  define HAVE_STDARG_H 1
24 #  define HAVE_WINSVC_H 1
25 #  define HAVE_WINSOCK2_H 1
26 #  define HAVE_WINDOWSX_H 1
27 #endif /* __MINGW32__ */
29 #ifdef HAVE_WINDOWS_H
30 #  include <windows.h>
31 #endif
32 #ifdef HAVE_WINDOWSX_H
33 #  include <windowsx.h>
34 #endif
35 #ifdef HAVE_WINSOCK2_H
36 #  include <winsock2.h>
37 #endif
38 #ifdef HAVE_WINSVC_H
39 #  include <winsvc.h>
40 #endif
42 #define _USE_WIN32_ 1
44 #endif /* _LOCAL_WIN32_H */