History

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

fstd committed 11 years ago

Commit 4d063b81 parent 5373b8a1 file · +5 −0Browse files

Showing the changes to codec/common/src/WelsThreadLib.cpp (1 of 1 file). Show all

Unified · Split

codec/common/src/WelsThreadLib.cpp+5−0
@@ -504,7 +504,12 @@ WELS_THREAD_ERROR_CODE WelsQueryLogicalProcessInfo (WelsLogicalProcessInfo* p · 503 unmodified lines
504504
505505 size_t len = sizeof (pInfo->ProcessorCount);
506506
507+#if defined(__OpenBSD__)
508+ int scname[] = { CTL_HW, HW_NCPU };
509+ if (sysctl (scname, 2, &pInfo->ProcessorCount, &len, NULL, 0) == -1)
510+#else
507511 if (sysctlbyname (HW_NCPU_NAME, &pInfo->ProcessorCount, &len, NULL, 0) == -1)
512+#endif
508513 pInfo->ProcessorCount = 1;
509514
510515 return WELS_THREAD_ERROR_OK;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t