$OpenBSD: patch-auxil_highwayhash_highwayhash_os_specific_cc,v 1.3 2021/07/07 09:42:06 ajacoutot Exp $

Index: auxil/highwayhash/highwayhash/os_specific.cc
--- auxil/highwayhash/highwayhash/os_specific.cc.orig
+++ auxil/highwayhash/highwayhash/os_specific.cc
@@ -60,6 +60,12 @@
 #define OS_FREEBSD 0
 #endif
 
+#ifdef __OpenBSD__
+#define OS_OPENBSD 1
+#else
+#define OS_OPENBSD 0
+#endif
+
 namespace highwayhash {
 
 #define CHECK(condition)                                       \
@@ -104,7 +110,7 @@ void RaiseThreadPriority() {
 #elif OS_LINUX
   // omit: SCHED_RR and SCHED_FIFO with sched_priority max, max-1 and max/2
   // lead to 2-3x runtime and higher variability!
-#elif OS_FREEBSD || OS_MAC
+#elif OS_FREEBSD || OS_MAC || OS_OPENBSD
 #else
 #error "port"
 #endif
@@ -174,6 +180,7 @@ void SetThreadAffinity(ThreadAffinity* affinity) {
 #elif OS_MAC
   const int err = mac_setaffinity(&affinity->set);
   CHECK(err == 0);
+#elif OS_OPENBSD
 #else
 #error "port"
 #endif
@@ -207,6 +214,7 @@ std::vector<int> AvailableCPUs() {
       cpus.push_back(cpu);
     }
   }
+#elif OS_OPENBSD
 #else
 #error "port"
 #endif
@@ -226,6 +234,7 @@ void PinThreadToCPU(const int cpu) {
 #elif OS_MAC
   CPU_ZERO(&affinity.set);
   CPU_SET(cpu, &affinity.set);
+#elif OS_OPENBSD
 #else
 #error "port"
 #endif
