Merge pull request #2115 from fstd/support_netbsd_2

Support NetBSD and OpenBSD; consolidate BSD build.
This commit is contained in:
HaiboZhu 2015-09-16 09:07:08 +08:00
commit 8994f1f757
3 changed files with 6 additions and 1 deletions

View File

@ -7,7 +7,7 @@ vpath %.S $(SRC_PATH)
vpath %.rc $(SRC_PATH) vpath %.rc $(SRC_PATH)
vpath %.pc.in $(SRC_PATH) vpath %.pc.in $(SRC_PATH)
OS=$(shell uname | tr A-Z a-z | tr -d \\-[:digit:].) OS=$(shell uname | tr A-Z a-z | tr -d \\-[:digit:]. | sed -E 's/^(net|open|free)bsd/bsd/')
ARCH=$(shell uname -m) ARCH=$(shell uname -m)
LIBPREFIX=lib LIBPREFIX=lib
LIBSUFFIX=a LIBSUFFIX=a

View File

@ -504,7 +504,12 @@ WELS_THREAD_ERROR_CODE WelsQueryLogicalProcessInfo (WelsLogicalProcessInfo* p
size_t len = sizeof (pInfo->ProcessorCount); 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) if (sysctlbyname (HW_NCPU_NAME, &pInfo->ProcessorCount, &len, NULL, 0) == -1)
#endif
pInfo->ProcessorCount = 1; pInfo->ProcessorCount = 1;
return WELS_THREAD_ERROR_OK; return WELS_THREAD_ERROR_OK;