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_FGETLN 11#define HAVE_STRPTIME 12#define HAVE_GETSUBOPT 13#define HAVE_STRLCAT 14#define HAVE_MMAP 15#define HAVE_STRLCPY 16 17#include <sys/types.h> 18 19#if !defined(__BEGIN_DECLS) 20# ifdef __cplusplus 21# define __BEGIN_DECLS extern "C" { 22# else 23# define __BEGIN_DECLS 24# endif 25#endif 26#if !defined(__END_DECLS) 27# ifdef __cplusplus 28# define __END_DECLS } 29# else 30# define __END_DECLS 31# endif 32#endif 33 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) 42#endif 43 44#ifndef HAVE_STRLCAT 45extern size_t strlcat(char *, const char *, size_t); 46#endif 47#ifndef HAVE_STRLCPY 48extern size_t strlcpy(char *, const char *, size_t); 49#endif 50#ifndef HAVE_GETSUBOPT 51extern int getsubopt(char **, char * const *, char **); 52extern char *suboptarg; 53#endif 54#ifndef HAVE_FGETLN 55extern char *fgetln(FILE *, size_t *); 56#endif 57 58#endif /* MANDOC_CONFIG_H */ 59