shithub: openh264

Download patch

ref: 4d063b84cc2bfd7a597fed6f5125f8d85b82b8f1
parent: 5373b8a3aad243245c56e964efa8380ab1fcc44d
author: fstd <[email protected]>
date: Sat Sep 12 17:31:39 EDT 2015

Build successfully on OpenBSD (which lacks sysctlbyname(3))

--- a/codec/common/src/WelsThreadLib.cpp
+++ b/codec/common/src/WelsThreadLib.cpp
@@ -504,7 +504,12 @@
 
   size_t len = sizeof (pInfo->ProcessorCount);
 
+#if defined(__OpenBSD__)
+  int scname[] = { CTL_HW, HW_NCPU };
+  if (sysctl (scname, 2, &pInfo->ProcessorCount, &len, NULL, 0) == -1)
+#else
   if (sysctlbyname (HW_NCPU_NAME, &pInfo->ProcessorCount, &len, NULL, 0) == -1)
+#endif
     pInfo->ProcessorCount = 1;
 
   return WELS_THREAD_ERROR_OK;