summaryrefslogtreecommitdiff
path: root/src/ext
diff options
context:
space:
mode:
authorKris Katterjohn <katterjohn@gmail.com>2018-12-23 14:51:45 -0600
committerNick Mathewson <nickm@torproject.org>2019-01-09 08:51:57 -0500
commitc13a81f7f96a6433709b90c343d358c93cc7b9f8 (patch)
tree3de272b5929dcbcb0b77f4a6f1d5316d64925c4b /src/ext
parent44edfa7adcc3f9006397e525b0c4e333ea4ee429 (diff)
downloadtor-c13a81f7f96a6433709b90c343d358c93cc7b9f8.tar.gz
tor-c13a81f7f96a6433709b90c343d358c93cc7b9f8.zip
Fix (and make consistent) the use of OpenBSD preprocessor macro tests
Prior to this commit, the testsuite was failing on OpenBSD. After this commit the testsuite runs fine on OpenBSD. It was previously decided to test for the OpenBSD macro (rather than __OpenBSD__, etc.) because OpenBSD forks seem to have the former macro defined. sys/param.h must be included for the OpenBSD macro definition; however, many files tested for the OpenBSD macro without having this header included. This commit includes sys/param.h in the files where the OpenBSD macro is used (and sys/param.h is not already included), and it also changes some instances of the __OpenBSD__ macro to OpenBSD. See commit 27df23abb675ffeb198bf0c1cc85c4baed77a988 which changed everything to use OpenBSD instead of __OpenBSD__ or OPENBSD. See also tickets #6982 and #20980 (the latter ticket is where it was decided to use the OpenBSD macro). Signed-off-by: Kris Katterjohn <katterjohn@gmail.com>
Diffstat (limited to 'src/ext')
-rw-r--r--src/ext/byteorder.h4
-rw-r--r--src/ext/ed25519/donna/ed25519-donna-portable-identify.h2
-rw-r--r--src/ext/trunnel/trunnel.c6
3 files changed, 10 insertions, 2 deletions
diff --git a/src/ext/byteorder.h b/src/ext/byteorder.h
index c8ba52184b..95e080b14d 100644
--- a/src/ext/byteorder.h
+++ b/src/ext/byteorder.h
@@ -29,6 +29,10 @@
Jean-Philippe Aumasson (https://131002.net/siphash/siphash24.c)
*/
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+
/* This code is extracted from csiphash.h */
#if defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && \
diff --git a/src/ext/ed25519/donna/ed25519-donna-portable-identify.h b/src/ext/ed25519/donna/ed25519-donna-portable-identify.h
index 26a264cf9e..3e0f9cfc50 100644
--- a/src/ext/ed25519/donna/ed25519-donna-portable-identify.h
+++ b/src/ext/ed25519/donna/ed25519-donna-portable-identify.h
@@ -14,7 +14,7 @@
#define OS_OSX
#elif defined(macintosh) || defined(Macintosh)
#define OS_MAC
- #elif defined(__OpenBSD__)
+ #elif defined(OpenBSD)
#define OS_OPENBSD
#endif
#endif
diff --git a/src/ext/trunnel/trunnel.c b/src/ext/trunnel/trunnel.c
index b749d8136f..2442bc3909 100644
--- a/src/ext/trunnel/trunnel.c
+++ b/src/ext/trunnel/trunnel.c
@@ -14,6 +14,10 @@
#include <stdlib.h>
#include <string.h>
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+
#if defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && \
__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
# define IS_LITTLE_ENDIAN 1
@@ -31,7 +35,7 @@
# define IS_LITTLE_ENDIAN
# endif
#else
-# if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
+# if defined(__FreeBSD__) || defined(__NetBSD__) || defined(OpenBSD)
# include <sys/endian.h>
# else
# include <endian.h>