1 #ifndef MANDOC_CONFIG_H 2 #define MANDOC_CONFIG_H 3 4 #if defined(__linux__) || defined(__MINT__) 5 # define _GNU_SOURCE /* strptime(), getsubopt() */ 6 #endif 7 8 #include <stdio.h> 9 10 #define HAVE_STRPTIME 11 #define HAVE_GETSUBOPT 12 #define HAVE_STRLCAT 13 #define HAVE_STRLCPY 14 15 #include <sys/types.h> 16 17 #if !defined(__BEGIN_DECLS) 18 # ifdef __cplusplus 19 # define __BEGIN_DECLS extern "C" { 20 # else 21 # define __BEGIN_DECLS 22 # endif 23 #endif 24 #if !defined(__END_DECLS) 25 # ifdef __cplusplus 26 # define __END_DECLS } 27 # else 28 # define __END_DECLS 29 # endif 30 #endif 31 32 #if defined(__APPLE__) 33 # define htobe32(x) OSSwapHostToBigInt32(x) 34 # define betoh32(x) OSSwapBigToHostInt32(x) 35 # define htobe64(x) OSSwapHostToBigInt64(x) 36 # define betoh64(x) OSSwapBigToHostInt64(x) 37 #elif defined(__linux__) 38 # define betoh32(x) be32toh(x) 39 # define betoh64(x) be64toh(x) 40 #endif 41 42 #ifndef HAVE_STRLCAT 43 extern size_t strlcat(char *, const char *, size_t); 44 #endif 45 #ifndef HAVE_STRLCPY 46 extern size_t strlcpy(char *, const char *, size_t); 47 #endif 48 #ifndef HAVE_GETSUBOPT 49 extern int getsubopt(char **, char * const *, char **); 50 extern char *suboptarg; 51 #endif 52 #ifndef HAVE_FGETLN 53 extern char *fgetln(FILE *, size_t *); 54 #endif 55 56 #endif /* MANDOC_CONFIG_H */