Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
Dudemanguy committed Sep 21, 2023
1 parent be89e07 commit 73438ad
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 53 deletions.
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/pthread_wrapper.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
44 changes: 0 additions & 44 deletions osdep/win32/include/semaphore.h

This file was deleted.

3 changes: 0 additions & 3 deletions osdep/win32/pthread.c → osdep/win32/pthread_wrapper.c
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
22 changes: 22 additions & 0 deletions osdep/win32/include/pthread.h → osdep/win32/pthread_wrapper.h
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

0 comments on commit 73438ad

Please sign in to comment.