1 #ifndef MANDOC_CONFIG_H
2 #define MANDOC_CONFIG_H
4 #if defined(__linux__) || defined(__MINT__)
5 # define _GNU_SOURCE /* strptime(), getsubopt() */
12 #define HAVE_GETSUBOPT
17 #include <sys/types.h>
19 #if !defined(__BEGIN_DECLS)
21 # define __BEGIN_DECLS extern "C" {
23 # define __BEGIN_DECLS
26 #if !defined(__END_DECLS)
28 # define __END_DECLS }
34 #if defined(__APPLE__)
35 # define htobe32(x) OSSwapHostToBigInt32(x)
36 # define betoh32(x) OSSwapBigToHostInt32(x)
37 # define htobe64(x) OSSwapHostToBigInt64(x)
38 # define betoh64(x) OSSwapBigToHostInt64(x)
39 #elif defined(__linux__)
40 # define betoh32(x) be32toh(x)
41 # define betoh64(x) be64toh(x)
45 extern size_t strlcat(char *, const char *, size_t);
48 extern size_t strlcpy(char *, const char *, size_t);
50 #ifndef HAVE_GETSUBOPT
51 extern int getsubopt(char **, char * const *, char **);
52 extern char *suboptarg;
55 extern char *fgetln(FILE *, size_t *);
58 #endif /* MANDOC_CONFIG_H */