diff options
author | Kacper Michajłow <kasper93@gmail.com> | 2023-10-22 02:43:15 +0200 |
---|---|---|
committer | Dudemanguy <random342@airmail.cc> | 2023-11-05 17:36:17 +0000 |
commit | 56d35da180879ef86a15f89f1f870dcc1cb11e5f (patch) | |
tree | 4293ad8854541fc08fda8024e789144ae69ccca1 /test | |
parent | 55ed50ba901e70adda09f1cf8c0de7cf80cabeb3 (diff) | |
download | mpv-56d35da180879ef86a15f89f1f870dcc1cb11e5f.tar.bz2 mpv-56d35da180879ef86a15f89f1f870dcc1cb11e5f.tar.xz |
mp_thread: add win32 implementation
Diffstat (limited to 'test')
-rw-r--r-- | test/meson.build | 10 | ||||
-rw-r--r-- | test/timer.c | 3 |
2 files changed, 8 insertions, 5 deletions
diff --git a/test/meson.build b/test/meson.build index 0a40bb03e7..f65110967f 100644 --- a/test/meson.build +++ b/test/meson.build @@ -40,11 +40,12 @@ if win32 test_utils_files += 'osdep/windows_utils.c' endif +if features['pthread-debug'] + test_utils_files += 'osdep/threads.c' +endif + # The zimg code requires using threads. -if features['win32-internal-pthreads'] - test_utils_args += '-DWIN32_TESTS' - test_utils_files += ['osdep/win32/pthread.c'] -else +if not features['win32-threads'] test_utils_deps += pthreads endif @@ -59,7 +60,6 @@ test_utils = static_library('test-utils', 'test_utils.c', include_directories: i # For getting imgfmts and stuff. img_utils_files = [ 'misc/thread_pool.c', - 'osdep/threads.c', 'video/csputils.c', 'video/fmt-conversion.c', 'video/img_format.c', diff --git a/test/timer.c b/test/timer.c index 6fe7770c2e..f89fd7e310 100644 --- a/test/timer.c +++ b/test/timer.c @@ -1,6 +1,7 @@ #include "common/common.h" #include "osdep/timer.h" #include "test_utils.h" +#include "config.h" #include <time.h> #include <sys/time.h> @@ -37,6 +38,7 @@ int main(void) assert_int_equal(mp_time_ns_add(test2, 20.44), INT64_MAX); } +#if !HAVE_WIN32_THREADS /* conversion */ { struct timeval tv; @@ -49,6 +51,7 @@ int main(void) ts = mp_rel_time_to_timespec(0.0); assert_true(llabs(tv.tv_sec - ts.tv_sec) <= 1); } +#endif return 0; } |