diff options
Diffstat (limited to 'utils/config.h')
-rw-r--r-- | utils/config.h | 84 |
1 files changed, 72 insertions, 12 deletions
diff --git a/utils/config.h b/utils/config.h index ddd1c6e8e..f54326dba 100644 --- a/utils/config.h +++ b/utils/config.h @@ -16,21 +16,38 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef _NETSURF_UTILS_CONFIG_H_ -#define _NETSURF_UTILS_CONFIG_H_ +#ifndef NETSURF_UTILS_CONFIG_H_ +#define NETSURF_UTILS_CONFIG_H_ #include <stddef.h> +#if defined(__NetBSD__) +#include <sys/param.h> +#if (defined(__NetBSD_Version__) && __NetBSD_Prereq__(8,0,0)) +#define NetBSD_v8 +#endif +#endif + /* Try to detect which features the target OS supports */ -#if (defined(_GNU_SOURCE) && !defined(__APPLE__) || defined(__amigaos4__) || defined(__HAIKU__) || (defined(_POSIX_C_SOURCE) && ((_POSIX_C_SOURCE - 0) >= 200809L)) && !defined(__riscos__)) +#if (defined(_GNU_SOURCE) && \ + !defined(__APPLE__) || \ + defined(__amigaos4__) || \ + defined(__HAIKU__) || \ + (defined(_POSIX_C_SOURCE) && ((_POSIX_C_SOURCE - 0) >= 200809L)) && \ + !defined(__riscos__)) #define HAVE_STRNDUP #else #undef HAVE_STRNDUP char *strndup(const char *s, size_t n); #endif -#if (defined(_GNU_SOURCE) || defined(__APPLE__) || defined(__HAIKU__) || defined(__OpenBSD__)) +#if ((defined(_GNU_SOURCE) || \ + defined(__APPLE__) || \ + defined(__HAIKU__) || \ + defined(__NetBSD__) || \ + defined(__OpenBSD__)) && \ + !defined(__serenity__)) #define HAVE_STRCASESTR #else #undef HAVE_STRCASESTR @@ -40,7 +57,13 @@ char *strcasestr(const char *haystack, const char *needle); /* Although these platforms might have strftime or strptime they * appear not to support the time_t seconds format specifier. */ -#if (defined(_WIN32) || defined(__riscos__) || defined(__HAIKU__) || defined(__BEOS__) || defined(__amigaos4__) || defined(__AMIGA__) || defined(__MINT__)) +#if (defined(_WIN32) || \ + defined(__riscos__) || \ + defined(__HAIKU__) || \ + defined(__BEOS__) || \ + defined(__amigaos4__) || \ + defined(__AMIGA__) || \ + defined(__MINT__)) #undef HAVE_STRPTIME #undef HAVE_STRFTIME #else @@ -51,22 +74,36 @@ char *strcasestr(const char *haystack, const char *needle); /* For some reason, UnixLib defines this unconditionally. Assume we're using * UnixLib if building for RISC OS. */ -#if ((defined(_GNU_SOURCE) && !defined(__APPLE__)) || defined(__riscos__)) +#if ((defined(_GNU_SOURCE) && !defined(__APPLE__)) || \ + defined(__riscos__) || \ + defined(NetBSD_v8)) #define HAVE_STRCHRNUL #else #undef HAVE_STRCHRNUL char *strchrnul(const char *s, int c); #endif +/* + * amigaos3 declares this but does not have it in its actual library + */ +#define HAVE_STRTOULL +#if !defined(__amigaos4__) && defined(__AMIGA__) +#undef HAVE_STRTOULL +#endif + #define HAVE_SYS_SELECT -#define HAVE_INETATON #define HAVE_POSIX_INET_HEADERS #if (defined(_WIN32)) -#undef HAVE_INETATON #undef HAVE_SYS_SELECT #undef HAVE_POSIX_INET_HEADERS #endif +#define HAVE_INETATON +#if (defined(_WIN32) || \ + defined(__serenity__)) +#undef HAVE_INETATON +#endif + #define HAVE_INETPTON #if (defined(_WIN32)) #undef HAVE_INETPTON @@ -104,10 +141,31 @@ char *realpath(const char *path, char *resolved_path); #endif #define HAVE_SCANDIR -#if (defined(_WIN32)) +#if (defined(_WIN32) || \ + defined(__serenity__)) #undef HAVE_SCANDIR #endif +#define HAVE_DIRFD +#define HAVE_UNLINKAT +#define HAVE_FSTATAT +#if (defined(_WIN32) || defined(__riscos__) || defined(__HAIKU__) || defined(__BEOS__) || defined(__amigaos4__) || defined(__AMIGA__) || defined(__MINT__)) +#undef HAVE_DIRFD +#undef HAVE_UNLINKAT +#undef HAVE_FSTATAT +#endif + +#define HAVE_REGEX +#if (defined(__serenity__)) +#undef HAVE_REGEX +#endif + +/* execinfo available for backtrace */ +#if ((defined(__linux__) && defined(__GLIBC__) && !defined(__UCLIBC__)) || \ + defined(__APPLE__)) +#define HAVE_EXECINFO +#endif + /* This section toggles build options on and off. * Simply undefine a symbol to turn the relevant feature off. * @@ -133,9 +191,11 @@ char *realpath(const char *path, char *resolved_path); #define WITH_MMAP #endif -/* amiga */ -#if defined(__amigaos4__) || defined(__AMIGA__) || \ - defined(nsatari) +/* IPv6 */ +#if (defined(__amigaos4__) || \ + defined(__AMIGA__) || \ + defined(nsatari) || \ + defined(__serenity__)) #define NO_IPV6 #endif |