_beginthreadex is for desktop only. CreateThread is available for windows store apps on windows (and phone) 8.1 and later. http://msdn.microsoft.com/en-us/library/ms682453%28VS.85%29.aspx
Signed-off-by: Matt Oliver <protogonoi@gmail.com>
{
thread->func = start_routine;
thread->arg = arg;
+#if HAVE_WINRT
+ thread->handle = (void*)CreateThread(NULL, 0, win32thread_worker, thread,
+ 0, NULL);
+#else
thread->handle = (void*)_beginthreadex(NULL, 0, win32thread_worker, thread,
0, NULL);
+#endif
return !thread->handle;
}
dos_paths
dxva2api_cobj
dxva2_lib
+ winrt
libc_msvcrt
libdc1394_1
libdc1394_2
check_type "vdpau/vdpau.h" "VdpPictureInfoHEVC"
+check_cpp_condition windows.h "!WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)" && enable winrt || disable winrt
+
if ! disabled w32threads && ! enabled pthreads; then
check_func_headers "windows.h process.h" _beginthreadex &&
enable w32threads || disable w32threads
+ if ! enabled w32threads && enabled winrt; then
+ check_func_headers "windows.h" CreateThread &&
+ enable w32threads || disable w32threads
+ fi
fi
# check for some common methods of building with pthread support
#endif
#include <sched.h>
#endif
-#if HAVE_GETPROCESSAFFINITYMASK
+#if HAVE_GETPROCESSAFFINITYMASK || HAVE_WINRT
#include <windows.h>
#endif
#if HAVE_SYSCTL
static volatile int printed;
int nb_cpus = 1;
+#if HAVE_WINRT
+ SYSTEM_INFO sysinfo;
+#endif
#if HAVE_SCHED_GETAFFINITY && defined(CPU_COUNT)
cpu_set_t cpuset;
nb_cpus = sysconf(_SC_NPROC_ONLN);
#elif HAVE_SYSCONF && defined(_SC_NPROCESSORS_ONLN)
nb_cpus = sysconf(_SC_NPROCESSORS_ONLN);
+#elif HAVE_WINRT
+ GetNativeSystemInfo(&sysinfo);
+ nb_cpus = sysinfo.dwNumberOfProcessors;
#endif
if (!printed) {