Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test #8

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,6 @@ endif
# This currently works because these are the last flags set
# in the build for windows. Adding any new flags after this
# will probably break something.
includedir = []
win32_pthreads = get_option('win32-internal-pthreads').require(
win32 and not posix,
error_message: 'the os is not win32!',
Expand All @@ -362,8 +361,7 @@ if features['win32-internal-pthreads']
# Note: Adding this include causes POSIX_TIMERS to be defined for
# unclear reasons (some confusion with <pthread.h> probably).
# Hack around it by using HAVE_WIN32_INTERNAL_PTHREADS.
includedir += include_directories('osdep/win32/include')
sources += files('osdep/win32/pthread.c')
sources += files('osdep/win32/win32_internal_pthreads.c')
endif

pthread_debug = get_option('pthread-debug').require(
Expand Down Expand Up @@ -1724,8 +1722,8 @@ client_api_version = major + '.' + minor + '.0'

libmpv = library('mpv', sources, dependencies: dependencies, gnu_symbol_visibility: 'hidden',
link_args: cc.get_supported_link_arguments(['-Wl,-Bsymbolic']),
version: client_api_version, include_directories: includedir,
install: get_option('libmpv'), build_by_default: get_option('libmpv'))
version: client_api_version, install: get_option('libmpv'),
build_by_default: get_option('libmpv'))


if get_option('libmpv')
Expand Down Expand Up @@ -1767,7 +1765,7 @@ if get_option('cplayer')
install_data('etc/mpv-symbolic.svg', install_dir: join_paths(hicolor_dir, 'symbolic', 'apps'))

mpv = executable('mpv', objects: libmpv.extract_all_objects(recursive: true), dependencies: dependencies,
win_subsystem: 'windows,6.0', include_directories: includedir, install: true)
win_subsystem: 'windows,6.0', install: true)
endif

if get_option('tests')
Expand Down
4 changes: 4 additions & 0 deletions osdep/threads.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@
#include <pthread_np.h>
#endif

#if HAVE_WIN32_INTERNAL_PTHREADS
#include "osdep/win32/win32_internal_pthreads.h"
#endif

int mpthread_mutex_init_recursive(pthread_mutex_t *mutex)
{
pthread_mutexattr_t attr;
Expand Down
44 changes: 0 additions & 44 deletions osdep/win32/include/semaphore.h

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/

#include <pthread.h>
#include <semaphore.h>

#include <stdlib.h>
#include <stdint.h>
#include <errno.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,4 +96,26 @@ int pthread_create(pthread_t *thread, const pthread_attr_t *attr,

void pthread_set_name_np(pthread_t thread, const char *name);

#define sem_init m_sem_init
#define sem_destroy m_sem_destroy
#define sem_wait m_sem_wait
#define sem_trywait m_sem_trywait
#define sem_timedwait m_sem_timedwait
#define sem_post m_sem_post

#define SEM_VALUE_MAX 100

typedef struct {
pthread_mutex_t lock;
pthread_cond_t wakeup;
unsigned int value;
} sem_t;

int sem_init(sem_t *sem, int pshared, unsigned int value);
int sem_destroy(sem_t *sem);
int sem_wait(sem_t *sem);
int sem_trywait(sem_t *sem);
int sem_timedwait(sem_t *sem, const struct timespec *abs_timeout);
int sem_post(sem_t *sem);

#endif
2 changes: 1 addition & 1 deletion test/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ if features['win32-internal-pthreads']
test_utils_args += '-DWIN32_TESTS'
test_utils_files += ['osdep/timer.c',
'osdep/timer-win2.c',
'osdep/win32/pthread.c',
'osdep/win32/win32_internal_pthreads.c',
'osdep/windows_utils.c']
endif

Expand Down
Loading