diff options
author | Nick Mathewson <nickm@torproject.org> | 2012-05-16 14:31:36 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2012-05-16 14:34:17 -0400 |
commit | f35271bf3eceadd03bff26d34c1d020892d6c6f0 (patch) | |
tree | a74fad3643e97a71fdb5325d7d47d853dbb030b0 /src/common/torint.h | |
parent | 75fc4dbbcabaedc715f0f9e883ccab1c9634e787 (diff) | |
download | tor-f35271bf3eceadd03bff26d34c1d020892d6c6f0.tar.gz tor-f35271bf3eceadd03bff26d34c1d020892d6c6f0.zip |
Fix some more FreeBSD4 issues (based on a patch from grarpamp)
Apparently, freebsd 4 doesn't like malloc.h, needs sys/param.h for
MIN/MAX, and doesn't have a SIZE_MAX.
For bug 3894.
Diffstat (limited to 'src/common/torint.h')
-rw-r--r-- | src/common/torint.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/common/torint.h b/src/common/torint.h index 0b5c29adc0..2a1ca3051e 100644 --- a/src/common/torint.h +++ b/src/common/torint.h @@ -182,6 +182,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; |