[x264-devel] [PATCH 4/7] Implemented x264_cpu_num_processors() for OS/2

KO Myung-Hun komh at chollian.net
Thu Apr 14 15:59:59 CEST 2011


---
 common/cpu.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/common/cpu.c b/common/cpu.c
index 8793445..bad54f8 100644
--- a/common/cpu.c
+++ b/common/cpu.c
@@ -44,6 +44,10 @@
 #include <sys/sysctl.h>
 #include <machine/cpu.h>
 #endif
+#ifdef SYS_OS2
+#define INCL_DOS
+#include <os2.h>
+#endif
 
 const x264_cpu_name_t x264_cpu_names[] = {
     {"Altivec", X264_CPU_ALTIVEC},
@@ -389,6 +393,13 @@ int x264_cpu_num_processors( void )
     }
     return ncpu;
 
+#elif defined(SYS_OS2)
+    ULONG numprocs = 1;
+
+    DosQuerySysInfo(QSV_NUMPROCESSORS, QSV_NUMPROCESSORS, &numprocs, sizeof(numprocs));
+
+    return numprocs;
+
 #else
     return 1;
 #endif
-- 
1.7.3.2


More information about the x264-devel mailing list