Previously, with JACK installed, the configure script would enable the
JACK indev; this broke on OS X due to an incomplete pthreads
implementation. Add some simple macros to map libdispatch to pthreads
on OS X.
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
1. Manipulate waiting count in pthread_cond_wait()
2. Use builtin atomic functions to manipulate waiting count
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This is how the other perl scripts in git call perl
Reviewed-by: Ganesh Ajjanagadde <gajjanag@mit.edu>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
When SSE2 or higher compiler optimizations are used, mingw uses
the _mm_mfence intrinsic for MemoryBarrier, however it doesn't include
the appropriate headers automatically.
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
When SSE2 or higher compiler optimizations are used, mingw uses
the _mm_mfence intrinsic for MemoryBarrier, however it doesn't include
the appropriate headers automatically.
The versioning facility in the Solaris linker differs from Linux in 3 ways:
1. It does not support globs in linker scripts for
symbol versioning -- this is a GNU extension.
2. The linker argument is '-M', instead of '--version-script'.
3. It is picky about line endings.
Each symbol or directive must be on a line of it's own.
Let's use make_sunver.pl from GCC to generate a version script that works
correctly with the Solaris linker. It's function is to correctly expand the
globs in the original generated version script.
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
This removes the requirement of calling w32thread_init before being
able to use the threading primitives.
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
The emulation uses native InitOnce* APIs on Windows Vista+, and a
lock-free/allocation-free approach using atomics and spinning for
Windows XP.
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
favor link over link.exe in case some wrapper script already exists
fallback to "link" in the path if the one next to cl is not found
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
If the user attempts to use AviSynth 2.5, an error message will
now tell them they need to upgrade.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
The demuxer doesn't use these functions, so it shouldn't affect
anything. Investigate whether this can be fixed by how headers
are checked in configure.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Wrap the function calls in a similar fashion to how it's being done
with the critical section API.
Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Martin Storsjö <martin@martin.st>
This silences warnings about passing arguments from incompatible pointer type
when targeting Windows Vista or newer.
Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Martin Storsjö <martin@martin.st>
Wrap the function calls in a similar fashion to how it's being done
with the critical section API.
Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: James Almer <jamrial@gmail.com>
This silences warnings about passing arguments from incompatible pointer type
when targeting Windows Vista or newer.
Tested-by: Matt Oliver <protogonoi@gmail.com>
Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: James Almer <jamrial@gmail.com>
This avoids annoying warnings about unused functions. The compatibility
wrapper is designed to provide a complete (stub) API, so some functions
being unused by some files is natural and no reason for a warning.
When explicitly targeting Vista or newer (which only happens if the
caller explicitly sets _WIN32_WINNT to a high enough value via the
extra cflags option - otherwise configure script sets
-D_WIN32_WINNT=0x0502), we already unconditionally link to the
ConditionVariable functions, since 4622f11f9.
Similarly use the newer -Ex versions of CreateEvent, CreateSemaphore,
InitializeCriticalSection and WaitForSingleObject, that all appeared
in Vista. When building Windows Store applications, the older versions
of these functions aren't available, only the -Ex functions. When
doing such a build, the user can set -D_WIN32_WINNT=0x0600 to
forcibly use the newer functions instead.
Signed-off-by: Martin Storsjö <martin@martin.st>
The values of {FLT,DBL}_{MAX,MIN} macros on some systems (older musl
libc, some BSD flavours) are not exactly representable, i.e.
(double)DBL_MAX == DBL_MAX is false
This violates (at least some interpretations of) the C99 standard and
breaks code (e.g. in vf_fps) like
double f = DBL_MAX;
[...]
if (f == DBL_MAX) { // f has not been changed yet
[....]
}
Since we have this compat/va_copy.h header already we might just as well make
use of it for more than one compiler.
Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
This reverts commit 4622f11f9c.
The compiler should be able to do the dead code elimination now
without this when the cond_* names point directly to the real
functions instead of to local function pointers.
Signed-off-by: Martin Storsjö <martin@martin.st>
This reduces the call overhead slightly. More noticeably, it
restores the earlier (unintended?) feature that condition variable
functions work just fine even if w32thread_init() hasn't been called.
This was broken as a side effect of 4622f11f9, if explicitly targeting
Vista+.
This makes w32threading work in VP8 again, if targeting Vista+.
Signed-off-by: Martin Storsjö <martin@martin.st>
The emulation code is not needed when targetting Vista+
This helps getting rid of CreateSemaphore symbol, which is
forbidden in Windows Store apps.
Signed-off-by: Martin Storsjö <martin@martin.st>
Uses the 2.5 compatibility header included with the variant of
FFMS2 that uses AviSynth's C-interface. A copy of this header is
now provided in compat/avisynth.
avs_get_row_size_p and avs_get_height_p changed between versions
2.5 and 2.6. Since the avisynth_c.h header that avformat uses
assumes AviSynth 2.6, it would cause 2.5 to crash if given any
kind of real video (the Version() function was known to work,
though).
AvxSynth was unaffected by this issue because, despite being based
on AviSynth 2.5.8 and using 2.5.8's interface version number of 3,
it actually uses 2.6's versions of these functions.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>