Commit dc015254 authored by Derek Buitenhuis's avatar Derek Buitenhuis

Merge commit '6bb99757'

* commit '6bb99757':
  jack: Support OSX
Merged-by: 's avatarDerek Buitenhuis <derek.buitenhuis@gmail.com>
parents f3972b3b 6bb99757
/*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef COMPAT_DISPATCH_SEMAPHORE_SEMAPHORE_H
#define COMPAT_DISPATCH_SEMAPHORE_SEMAPHORE_H
#include <dispatch/dispatch.h>
#include <errno.h>
#define sem_t dispatch_semaphore_t
#define sem_post(psem) dispatch_semaphore_signal(*psem)
#define sem_wait(psem) dispatch_semaphore_wait(*psem, DISPATCH_TIME_FOREVER)
#define sem_timedwait(psem, val) dispatch_semaphore_wait(*psem, dispatch_walltime(val, 0))
#define sem_destroy(psem) dispatch_release(*psem)
static inline int compat_sem_init(dispatch_semaphore_t *psem,
int unused, int val)
{
int ret = !!(*psem = dispatch_semaphore_create(val)) - 1;
if (ret < 0)
errno = ENOMEM;
return ret;
}
#define sem_init compat_sem_init
#endif /* COMPAT_DISPATCH_SEMAPHORE_SEMAPHORE_H */
...@@ -4615,7 +4615,8 @@ case $target_os in ...@@ -4615,7 +4615,8 @@ case $target_os in
enabled x86_64 && objformat="macho64" enabled x86_64 && objformat="macho64"
enabled_any pic shared x86_64 || enabled_any pic shared x86_64 ||
{ check_cflags -mdynamic-no-pic && add_asflags -mdynamic-no-pic; } { check_cflags -mdynamic-no-pic && add_asflags -mdynamic-no-pic; }
check_header dispatch/dispatch.h check_header dispatch/dispatch.h &&
add_cppflags '-I\$(SRC_PATH)/compat/dispatch_semaphore'
;; ;;
msys*) msys*)
die "Native MSYS builds are discouraged, please use the MINGW environment."; die "Native MSYS builds are discouraged, please use the MINGW environment.";
...@@ -5522,6 +5523,9 @@ if enabled pthreads; then ...@@ -5522,6 +5523,9 @@ if enabled pthreads; then
check_func pthread_cancel check_func pthread_cancel
fi fi
enabled pthreads &&
check_builtin sem_timedwait semaphore.h "sem_t *s; sem_init(s,0,0); sem_timedwait(s,0); sem_destroy(s)"
disabled zlib || check_lib zlib.h zlibVersion -lz || disable zlib disabled zlib || check_lib zlib.h zlibVersion -lz || disable zlib
disabled bzlib || check_lib2 bzlib.h BZ2_bzlibVersion -lbz2 || disable bzlib disabled bzlib || check_lib2 bzlib.h BZ2_bzlibVersion -lbz2 || disable bzlib
disabled lzma || check_lib2 lzma.h lzma_version_number -llzma || disable lzma disabled lzma || check_lib2 lzma.h lzma_version_number -llzma || disable lzma
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment