1838846e7STrond Norbye/* -*- Mode: C; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
2838846e7STrond Norbye#ifndef CONFIG_H
3838846e7STrond Norbye#define CONFIG_H 1
4838846e7STrond Norbye
57d4ff237STrond Norbye#cmakedefine HAVE_UMEM_H ${HAVE_UMEM_H}
67d4ff237STrond Norbye#cmakedefine HAVE_SYSEXITS_H ${HAVE_SYSEXITS_H}
77d4ff237STrond Norbye
87d4ff237STrond Norbye#include <platform/platform.h>
97d4ff237STrond Norbye
10838846e7STrond Norbye#ifdef WIN32
11838846e7STrond Norbye#include <ws2tcpip.h>
12838846e7STrond Norbye
13c2d0114bSTrond Norbyeextern char *strsep(char **stringp, const char *pattern);
14c2d0114bSTrond Norbye
15838846e7STrond Norbye#define PATH_MAX 1024
16838846e7STrond Norbye
17838846e7STrond Norbye/* @todo investigate this one.. */
18838846e7STrond Norbye
19838846e7STrond Norbye#define SOCKETPAIR_AF AF_INET
20838846e7STrond Norbye#define get_socket_error() WSAGetLastError()
21838846e7STrond Norbye
22838846e7STrond Norbyetypedef HANDLE pid_t;
237d4ff237STrond Norbyetypedef char* caddr_t;
24838846e7STrond Norbye
25838846e7STrond Norbye#define snprintf _snprintf
26838846e7STrond Norbye#define strtoull(a, b, c) _strtoui64(a, b, c)
27838846e7STrond Norbye#define strtoll(a, b, c) _strtoi64(a, b, c)
28838846e7STrond Norbye/* to stop the stupid compiler to whine about this.. */
29838846e7STrond Norbye#ifndef __cplusplus
30838846e7STrond Norbye#define strdup(a) _strdup(a)
31838846e7STrond Norbye#define putenv(a) _putenv(a)
32838846e7STrond Norbye#endif
33838846e7STrond Norbye
34838846e7STrond Norbye
35838846e7STrond Norbye#else
36838846e7STrond Norbye
37838846e7STrond Norbye#if !defined(__cplusplus) && !defined(linux) && !defined(__GNUC__)
38838846e7STrond Norbyetypedef unsigned long long uint64_t;
39838846e7STrond Norbyetypedef long long int64_t;
40838846e7STrond Norbye#endif
41838846e7STrond Norbye
42838846e7STrond Norbye#define closesocket(a) close(a)
43838846e7STrond Norbye#define SOCKET int
44838846e7STrond Norbye#define SOCKETPAIR_AF AF_UNIX
45838846e7STrond Norbye#define SOCKET_ERROR -1
46838846e7STrond Norbye#define INVALID_SOCKET -1
47838846e7STrond Norbye#define get_socket_error() errno
48838846e7STrond Norbye
49838846e7STrond Norbye/* some POSIX systems need the following definition
507d4ff237STrond Norbye* to get mlockall flags out of sys/mman.h.  */
51838846e7STrond Norbye#ifndef _P1003_1B_VISIBLE
52838846e7STrond Norbye#define _P1003_1B_VISIBLE
53838846e7STrond Norbye#endif
54838846e7STrond Norbye/* need this to get IOV_MAX on some platforms. */
55838846e7STrond Norbye#ifndef __need_IOV_MAX
56838846e7STrond Norbye#define __need_IOV_MAX
57838846e7STrond Norbye#endif
58838846e7STrond Norbye
59838846e7STrond Norbye#ifndef _POSIX_PTHREAD_SEMANTICS
60838846e7STrond Norbye#define _POSIX_PTHREAD_SEMANTICS
61838846e7STrond Norbye#endif
62838846e7STrond Norbye
63838846e7STrond Norbye#ifdef __sun
64838846e7STrond Norbye#include <priv.h>
65838846e7STrond Norbye#define HAVE_DROP_PRIVILEGES 1
66838846e7STrond Norbye#endif
67838846e7STrond Norbye
68838846e7STrond Norbye#define HAVE_SIGIGNORE 1
695b136ab0STrond Norbye#define HAVE_SIGPIPE 1
705b136ab0STrond Norbye#define HAVE_SYS_UN_H 1
715b136ab0STrond Norbye#cmakedefine HAVE_GETPWNAM ${HAVE_GETPWNAM}
725b136ab0STrond Norbye#cmakedefine HAVE_GETRLIMIT ${HAVE_GETRLIMIT}
735b136ab0STrond Norbye#cmakedefine HAVE_MLOCKALL ${HAVE_MLOCKALL}
745b136ab0STrond Norbye#cmakedefine HAVE_GETPAGESIZES ${HAVE_GETPAGESIZES}
75838846e7STrond Norbye
76838846e7STrond Norbye
77838846e7STrond Norbye#include <sys/wait.h>
78838846e7STrond Norbye#include <sys/socket.h>
79838846e7STrond Norbye#include <netinet/in.h>
80838846e7STrond Norbye#include <netdb.h>
81838846e7STrond Norbye#include <unistd.h>
82838846e7STrond Norbye#include <sys/stat.h>
83838846e7STrond Norbye#include <sys/un.h>
84838846e7STrond Norbye#include <sys/resource.h>
85838846e7STrond Norbye#include <sys/uio.h>
86838846e7STrond Norbye#include <netinet/tcp.h>
87838846e7STrond Norbye#include <arpa/inet.h>
88838846e7STrond Norbye#include <sys/mman.h>
89838846e7STrond Norbye#include <pwd.h>
90838846e7STrond Norbye#include <sys/time.h>
91838846e7STrond Norbye#include <signal.h>
92838846e7STrond Norbye
93838846e7STrond Norbye/* @todo trondn fixme!! */
94838846e7STrond Norbye#if !defined(__cplusplus) && !defined(PRIu64)
95838846e7STrond Norbye#define PRIu64 "lu"
96838846e7STrond Norbye#endif
97838846e7STrond Norbye
98838846e7STrond Norbye#if !defined(__cplusplus) && !defined(PRIu32)
99838846e7STrond Norbye#define PRIu32 "u"
100838846e7STrond Norbye#endif
101838846e7STrond Norbye
102838846e7STrond Norbye
103838846e7STrond Norbye#endif
104838846e7STrond Norbye
105838846e7STrond Norbye/* Common section */
106838846e7STrond Norbye#include <stdlib.h>
107838846e7STrond Norbye#include <inttypes.h>
108838846e7STrond Norbye#include <sys/types.h>
109838846e7STrond Norbye
1107d4ff237STrond Norbye#ifdef HAVE_SYSEXITS_H
1117d4ff237STrond Norbye#include <sysexits.h>
1127d4ff237STrond Norbye#else
1137d4ff237STrond Norbye#define EX_USAGE EXIT_FAILURE
1147d4ff237STrond Norbye#define EX_OSERR EXIT_FAILURE
115838846e7STrond Norbye#endif
116838846e7STrond Norbye
1177d4ff237STrond Norbye#ifndef __cplusplus
1187d4ff237STrond Norbye#include <stdbool.h>
119838846e7STrond Norbye#endif
120838846e7STrond Norbye
121838846e7STrond Norbye#ifndef IOV_MAX
122838846e7STrond Norbye# define IOV_MAX 1024
123838846e7STrond Norbye#endif
124838846e7STrond Norbye#define SASL_ENABLED
125838846e7STrond Norbye
126838846e7STrond Norbye#define PACKAGE "moxi"
1275ab60b49STrond Norbye#define VERSION "${PRODUCT_VERSION}"
128838846e7STrond Norbye#define CONFLATE_DB_PATH "${CONFLATE_DB_PATH}"
129838846e7STrond Norbye
130a1ad8ab5STrond Norbye#include <event.h>
131a1ad8ab5STrond Norbye
132a1ad8ab5STrond Norbye#ifndef DEFAULT_ERRORLOG
133a1ad8ab5STrond Norbye#define DEFAULT_ERRORLOG ERRORLOG_STDERR
134a1ad8ab5STrond Norbye#endif
135a1ad8ab5STrond Norbye
136a1ad8ab5STrond Norbye#if defined(WORDS_BIGENDIAN) && WORDS_BIGENDIAN > 1
137a1ad8ab5STrond Norbye#define ENDIAN_BIG 1
138a1ad8ab5STrond Norbye#else
139a1ad8ab5STrond Norbye#define ENDIAN_LITTLE 1
140a1ad8ab5STrond Norbye#endif
141a1ad8ab5STrond Norbye
142838846e7STrond Norbye#endif
143