]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Fix compilation errors for FreeBSD
authorDavid Goulet <dgoulet@torproject.org>
Tue, 22 Aug 2023 17:37:25 +0000 (13:37 -0400)
committerDavid Goulet <dgoulet@torproject.org>
Tue, 22 Aug 2023 17:37:25 +0000 (13:37 -0400)
Signed-off-by: David Goulet <dgoulet@torproject.org>
changes/ticket40825 [new file with mode: 0644]
src/lib/osinfo/libc.c

diff --git a/changes/ticket40825 b/changes/ticket40825
new file mode 100644 (file)
index 0000000..36b5db2
--- /dev/null
@@ -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.
index 1ca26ff707e48fcec9a188f2339708887f10a366..f7cfde8642f5684d9779e69bbc0980ed7a455d8f 100644 (file)
 #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)