diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/common/compat.h | 3 | ||||
-rw-r--r-- | src/common/torint.h | 10 | ||||
-rw-r--r-- | src/common/util.c | 2 |
3 files changed, 14 insertions, 1 deletions
diff --git a/src/common/compat.h b/src/common/compat.h index 23081ac495..4efb0c8b8c 100644 --- a/src/common/compat.h +++ b/src/common/compat.h @@ -20,6 +20,9 @@ #include <ws2tcpip.h> #endif #endif +#ifdef HAVE_SYS_PARAM_H +#include <sys/param.h> +#endif #ifdef HAVE_SYS_TYPES_H #include <sys/types.h> #endif diff --git a/src/common/torint.h b/src/common/torint.h index 09495ac588..8771802d70 100644 --- a/src/common/torint.h +++ b/src/common/torint.h @@ -191,6 +191,16 @@ typedef unsigned __int64 uint64_t; #endif #endif +#ifndef SIZE_MAX +#if SIZEOF_SIZE_T == 8 +#define SIZE_MAX UINT64_MAX +#elif SIZEOF_SIZE_T == 4 +#define SIZE_MAX UINT32_MAX +#else +#error "Can't define SIZE_MAX" +#endif +#endif + #ifndef HAVE_SSIZE_T #if SIZEOF_SIZE_T == 8 typedef int64_t ssize_t; diff --git a/src/common/util.c b/src/common/util.c index 09cb2e966f..74f8bd84b6 100644 --- a/src/common/util.c +++ b/src/common/util.c @@ -80,7 +80,7 @@ #include <malloc/malloc.h> #endif #ifdef HAVE_MALLOC_H -#ifndef OPENBSD +#if !defined(OPENBSD) && !defined(__FreeBSD__) /* OpenBSD has a malloc.h, but for our purposes, it only exists in order to * scold us for being so stupid as to autodetect its presence. To be fair, * they've done this since 1996, when autoconf was only 5 years old. */ |