tor

The Tor anonymity network
git clone https://git.dasho.dev/tor.git
Log | Files | Refs | README | LICENSE

commit c3bc04e355e67e6cb6c8b87ca8967887770d2b08
parent 554d8407421c0969d4aaa5f86bcf59dd495e86e5
Author: David Goulet <dgoulet@torproject.org>
Date:   Tue, 22 Aug 2023 13:37:25 -0400

Fix compilation errors for FreeBSD

Signed-off-by: David Goulet <dgoulet@torproject.org>

Diffstat:
Achanges/ticket40825 | 3+++
Msrc/lib/osinfo/libc.c | 7++++---
2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/changes/ticket40825 b/changes/ticket40825 @@ -0,0 +1,3 @@ + o Minor bugfix (FreeBSD, compilation): + - Fix compilation issue on FreeBSD by properly importing sys/param.h. Fixes + bug 40825; bugfix on 0.4.8.1-alpha. diff --git a/src/lib/osinfo/libc.c b/src/lib/osinfo/libc.c @@ -26,6 +26,10 @@ #define STR_IMPL(x) #x #define STR(x) STR_IMPL(x) +#if defined(__BSD_VISIBLE) || defined(__NETBSD_SOURCE) +#include <sys/param.h> +#endif /* defined(__BSD_VISIBLE) || defined(__NETBSD_SOURCE) */ + /** Return the name of the compile time libc. Returns NULL if we * cannot identify the libc. */ const char * @@ -46,8 +50,6 @@ tor_libc_get_name(void) const char * tor_libc_get_version_str(void) { -#if defined(__BSD_VISIBLE) || defined(__NETBSD_SOURCE) -#include <sys/param.h> #ifdef __DragonFly_version return STR(__DragonFly_version); #endif @@ -60,7 +62,6 @@ tor_libc_get_version_str(void) #ifdef OpenBSD return STR(OpenBSD); #endif -#endif /* defined(__BSD_VISIBLE) || defined(__NETBSD_SOURCE) */ #ifdef CHECK_LIBC_VERSION const char *version = gnu_get_libc_version(); if (version == NULL)