diff options
author | David Goulet <dgoulet@torproject.org> | 2023-08-22 13:37:25 -0400 |
---|---|---|
committer | David Goulet <dgoulet@torproject.org> | 2023-08-22 13:37:25 -0400 |
commit | c3bc04e355e67e6cb6c8b87ca8967887770d2b08 (patch) | |
tree | 041a79a1f1984e29868af106c90f405e04ab1501 /src/lib | |
parent | 554d8407421c0969d4aaa5f86bcf59dd495e86e5 (diff) | |
download | tor-c3bc04e355e67e6cb6c8b87ca8967887770d2b08.tar.gz tor-c3bc04e355e67e6cb6c8b87ca8967887770d2b08.zip |
Fix compilation errors for FreeBSD
Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/osinfo/libc.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/lib/osinfo/libc.c b/src/lib/osinfo/libc.c index 1ca26ff707..f7cfde8642 100644 --- 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) |