summaryrefslogtreecommitdiff
path: root/libs/pbd/cpus.cc
diff options
context:
space:
mode:
authorGreg Zharun <grygoriiz@wavesglobal.com>2014-12-23 17:43:02 +0200
committerPaul Davis <paul@linuxaudiosystems.com>2014-12-23 12:55:35 -0500
commitaa80515f3fff3ffcbd16c90dbf55f579a6c20f8a (patch)
tree65c246b75b8d16390b961587751cfd2b727084cd /libs/pbd/cpus.cc
parentea2e80f2984ebeefdda293b90c3593fd7f94dd83 (diff)
[Summary] Fixed audio export on Windows. Added support of windows platform for the function that calculated hardware concurrency.
Because there was no implementation for this function on windows it used to return 0. This meant that no thread was created to process the data.
Diffstat (limited to 'libs/pbd/cpus.cc')
-rw-r--r--libs/pbd/cpus.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/libs/pbd/cpus.cc b/libs/pbd/cpus.cc
index 0f73d51027..ffb11871ba 100644
--- a/libs/pbd/cpus.cc
+++ b/libs/pbd/cpus.cc
@@ -28,6 +28,8 @@
#include <stddef.h>
#include <sys/types.h>
#include <sys/sysctl.h>
+#elif defined(PLATFORM_WINDOWS)
+#include <Windows.h>
#endif
#include "pbd/cpus.h"
@@ -48,6 +50,10 @@ hardware_concurrency()
#elif defined(HAVE_UNISTD) && defined(_SC_NPROCESSORS_ONLN)
int const count=sysconf(_SC_NPROCESSORS_ONLN);
return (count>0)?count:0;
+#elif defined(PLATFORM_WINDOWS)
+ SYSTEM_INFO sys_info;
+ GetSystemInfo( &sys_info );
+ return sys_info.dwNumberOfProcessors;
#else
return 0;
#endif