The configfile-branch now compiles.
[collectd.git] / src / libconfig / compat.h
1 #ifndef RSK_COMPAT_H
2 #define RSK_COMPAT_H
3
4 #ifdef HAVE_CONFIG_H
5 #include <config.h>
6 #endif
7 #ifdef __WIN32__
8 #include "win32.h"
9 #endif
10
11 #ifndef LC_LINEBUF_LEN
12 #define LC_LINEBUF_LEN 1024
13 #endif
14
15 #ifdef HAVE_INTTYPES_H
16 #include <inttypes.h>
17 #endif
18 #ifdef HAVE_MEMORY_H
19 #include <memory.h>
20 #endif
21 #ifdef HAVE_STDINT_H
22 #include <stdint.h>
23 #endif
24 #ifdef HAVE_STDLIB_H
25 #include <stdlib.h>
26 #endif
27 #ifdef HAVE_STRINGS_H
28 #include <strings.h>
29 #endif
30 #ifdef HAVE_STRING_H
31 #include <string.h>
32 #endif
33 #ifdef HAVE_SYS_STAT_H
34 #include <sys/stat.h>
35 #endif
36 #ifdef HAVE_SYS_TYPES_H
37 #include <sys/types.h>
38 #endif
39 #ifdef HAVE_UNISTD_H
40 #include <unistd.h>
41 #endif
42 #ifdef HAVE_ARPA_INET_H
43 #include <arpa/inet.h>
44 #endif
45 #ifdef HAVE_ERRNO_H
46 #include <errno.h>
47 #endif
48 #ifdef HAVE_FCNTL_H
49 #include <fcntl.h>
50 #endif
51 #ifdef HAVE_NETDB_H
52 #include <netdb.h>
53 #endif
54 #ifdef HAVE_NETINET_IN_H
55 #include <netinet/in.h>
56 #endif
57 #ifdef HAVE_STDARG_H
58 #include <stdarg.h>
59 #endif
60 #ifdef HAVE_STDIO_H
61 #include <stdio.h>
62 #endif
63 #ifdef HAVE_SYS_SOCKET_H
64 #include <sys/socket.h>
65 #endif
66 #ifdef TIME_WITH_SYS_TIME
67 #include <sys/time.h>
68 #include <time.h>
69 #else
70 #ifdef HAVE_SYS_TIME_H
71 #include <sys/time.h>
72 #else
73 #include <time.h>
74 #endif
75 #endif
76
77 #ifdef HAVE_OPENNET_H
78 #include <opennet.h>
79 #endif
80 #ifdef HAVE_LIBOPENNET
81 #define lc_fopen(path, mode) fopen_net(path, mode)
82 #define lc_fgets(buf, size, stream) fgets_net(buf, size, stream)
83 #define lc_feof(stream) feof_net(stream)
84 #define lc_fclose(stream) fclose_net(stream)
85 #define LC_FILE NETFILE
86 #else
87 #define lc_fopen(path, mode) fopen(path, mode)
88 #define lc_fgets(buf, size, stream) fgets(buf, size, stream)
89 #define lc_feof(stream) feof(stream)
90 #define lc_fclose(stream) fclose(stream)
91 #define LC_FILE FILE
92 #endif
93
94 #endif