mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-10 08:36:32 +01:00
Enable build for FreeBSD (part 1/2)
Adopted from Michael Beer -- GH pull-request #232 with minor changes: * rebased on master, * removed trailing whitespace, * don't explicitly change saved configuration defaults (wscript) * moved sys/wait (WNOHANG) to header include * separate changes in GUI and lib
This commit is contained in:
parent
e37b250d4d
commit
86763cba90
10 changed files with 26 additions and 7 deletions
|
|
@ -43,10 +43,14 @@ hardware_concurrency()
|
|||
{
|
||||
#if defined(PTW32_VERSION) || defined(__hpux)
|
||||
return pthread_num_processors_np();
|
||||
#elif defined(__APPLE__) || defined(__FreeBSD__)
|
||||
#elif defined(__APPLE__)
|
||||
int count;
|
||||
size_t size=sizeof(count);
|
||||
return sysctlbyname("hw.physicalcpu",&count,&size,NULL,0)?0:count;
|
||||
#elif defined(__FreeBSD__)
|
||||
int count;
|
||||
size_t size=sizeof(count);
|
||||
return sysctlbyname("hw.ncpu",&count,&size,NULL,0)?0:count;
|
||||
#elif defined(HAVE_UNISTD) && defined(_SC_NPROCESSORS_ONLN)
|
||||
int const count=sysconf(_SC_NPROCESSORS_ONLN);
|
||||
return (count>0)?count:0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue