summaryrefslogtreecommitdiff
path: root/compat
Commit message (Collapse)AuthorAge
* w32pthreads: always use Vista+ API, drop XP supportwm42018-04-09
| | | | | | | | | | | | This removes the XP compatibility code, and switches entirely to SRW locks, which are available starting at Windows Vista. This removes CRITICAL_SECTION use, which allows us to add PTHREAD_MUTEX_INITIALIZER, which will be useful later. Windows XP is hereby not a supported build target anymore. Signed-off-by: Diego Biurrun <diego@biurrun.de>
* makedef: Pass EXTERN_PREFIX from configure to makedefMartin Storsjö2017-11-16
| | | | | | | | | | This avoids having to use either "dumpbin -headers" to find out the current architecture, or pass $ARCH from configure to deduce it. When configuring with --disable-asm, ARCH is equal to "c", which doesn't give any indication of what symbol prefix is to be used. Signed-off-by: Martin Storsjö <martin@martin.st>
* build: Drop support for legacy TI ARM compilerDiego Biurrun2017-10-25
|
* makedef: Add support for identifying the ARM64 machine typeMartin Storsjö2017-10-12
| | | | | | | | Since this machine type is 5 chars while the existing ones only were 3 (which the regexp assumed), the regexp has to be extended a little. Signed-off-by: Martin Storsjö <martin@martin.st>
* makedef: Extend the script for use with mingw tools as wellMartin Storsjö2017-08-31
| | | | | | | | | This is invoked by setting the NM and AR variables to the names of those specific tools. The ARCH variable also needs to be provided, to choose the symbol prefix (nm doesn't provide any option that dumps the architecture easily). Signed-off-by: Martin Storsjö <martin@martin.st>
* makedef: Fold as much text transformations as possible into the initial dumpMartin Storsjö2017-08-31
| | | | | | This avoids redoing them for each expression in the list. Signed-off-by: Martin Storsjö <martin@martin.st>
* compat/atomics: add typecasts in atomic_compare_exchange_strong()Wan-Teh Chang2016-12-08
| | | | | | | | | | | | | | | | | | | | | The Solaris and Windows emulations of atomic_compare_exchange_strong() need typecasts to avoid compiler warnings, because the functions they call expect a void* pointer but an intptr_t integer is passed. Note that the emulations of atomic_compare_exchange_strong() (except the gcc version) only work for atomic_intptr_t because of the type of the second argument (|expected|). See http://en.cppreference.com/w/c/atomic: _Bool atomic_compare_exchange_strong( volatile A* obj, C* expected, C desired ); The types of the first argument and second argument are different (|A| and |C|, respectively). |C| is the non-atomic type corresponding to |A|. In the emulations of atomic_compare_exchange_strong(), |C| is intptr_t. This implies |A| can only be sig_intptr_t. Signed-off-by: Wan-Teh Chang <wtc@google.com>
* Remove Plan 9 supportDiego Biurrun2016-12-03
| | | | | | Supporting the system was a nice joke for the 9 release, but it has run its course. Nowadays Plan 9 receives no testing and has no practical usefulness.
* w32pthreads: Fix function pointer castsDiego Biurrun2016-11-24
| | | | This eliminates a handful of warnings at every inclusion of the header.
* Add a compat dummy stdatomic.h used when threading is disabledAnton Khirnov2016-10-02
| | | | Adapted from the code by Rémi Denis-Courmont from VLC
* Add a compat stdatomic.h implementation based on pthreadsAnton Khirnov2016-10-02
| | | | Adapted from the code by Rémi Denis-Courmont from VLC
* Add a compat stdatomic.h implementation based on suncc atomicsAnton Khirnov2016-10-02
| | | | Adapted from the code by Rémi Denis-Courmont from VLC
* Add a compat stdatomic.h implementation based on windows atomicsAnton Khirnov2016-10-02
| | | | Adapted from the code by Rémi Denis-Courmont from VLC
* Add a compat stdatomic.h implementation based on GCC atomicsAnton Khirnov2016-10-02
| | | | Adapted from the code by Rémi Denis-Courmont from VLC
* jack: Support OSXJosh de Kock2016-03-31
| | | | | | | | | 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>
* w32pthreads: Map MemoryBarrier to __sync_synchronize on mingwMartin Storsjö2015-10-30
| | | | | | | This fixes building on older mingw (both mingw.org and mingw64; mingw64 from before May 2011). Signed-off-by: Martin Storsjö <martin@martin.st>
* w32pthreads: fix mingw build on x86 with -msse2 or higherHendrik Leppkes2015-10-16
| | | | | | | | 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>
* build: add Solaris symbol versioningSean McGovern2015-10-11
| | | | | | | | | | | | | | | | | | 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>
* w32pthreads: Load dynamically loaded functions on demandHendrik Leppkes2015-10-07
| | | | | | | 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>
* w32pthreads: Add pthread_once emulationHendrik Leppkes2015-10-07
| | | | | | | | 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>
* use a wrapper script to call MS link.exe to avoid mixing with /usr/bin/link.exeSteve Lhomme2015-07-24
| | | | | | Fallback to "link" in the path if the one next to cl is not found. Signed-off-by: Martin Storsjö <martin@martin.st>
* w32pthreads: use the condition variable API directly when targeting newer ↵James Almer2014-10-10
| | | | | | | | | | versions of Windows 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>
* w32pthreads: use the CONDITION_VARIABLE typedef if availableJames Almer2014-10-10
| | | | | | | | 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>
* cosmetics: Write NULL pointer equality checks more compactlyGabriel Dume2014-08-15
| | | | Signed-off-by: Diego Biurrun <diego@biurrun.de>
* w32pthreads: Mark functions in compatibility wrapper as av_unusedDiego Biurrun2014-08-15
| | | | | | 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.
* w32threads: Use newer thread synchronization functions when targeting VistaMartin Storsjö2014-08-13
| | | | | | | | | | | | | | | | | 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>
* Work around broken floating point limits on some systems.Anton Khirnov2014-03-10
| | | | | | | | | | | | | 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 [....] }
* build: Import makedef script from c99-to-c89Derek Buitenhuis2013-11-24
| | | | | | | This allows MSVC 2013 and ICL to build with no external dependencies. Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
* Remove #undefs for formerly forbidden system functionsDiego Biurrun2013-11-07
| | | | | The macros forbidding the system functions no longer exist, obviating the need for the #undefs.
* Revert "w32pthread: help compiler figure out undeeded code"Martin Storsjö2013-08-27
| | | | | | | | | | This reverts commit 4622f11f9c83db8a2e08408c71ff901826ca652c. 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>
* w32threads: Don't use function pointers when linking directly to newer APIsMartin Storsjö2013-08-27
| | | | | | | | | | | | 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>
* w32pthread: help compiler figure out undeeded codeRafaël Carré2013-08-21
| | | | | | | | 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>
* compat: Add missing license boilerplatesDiego Biurrun2013-07-18
|
* Employ consistent LIBAV_COMPAT_ multiple inclusion guards in compat/Diego Biurrun2013-07-18
| | | | Also fix a comment and an #endif comment.
* compat: wrap math.h to avoid AIX-specific clashesLuca Barbato2013-07-04
| | | | | AIX defines a class() function in its math.h header without any guard.
* w32pthreads: move from lavc to compat/Anton Khirnov2013-05-24
| | | | It will be used in other places than lavc.
* Use the avstring.h locale-independent character type functionsReimar Döffinger2013-03-07
| | | | | | Make sure the behavior does not change with the locale. Signed-off-by: Martin Storsjö <martin@martin.st>
* build: Plan 9 supportMans Rullgard2012-10-23
| | | | | | | | | | | | | This adds support for building on Plan 9 x86-32. The compat/plan9 directory contains these items: - replacements for the 'head' and 'printf' shell commands - wrapper for main() to disable FPU exceptions Larger required changes to the system are described in the documentation. Signed-off-by: Mans Rullgard <mans@mansr.com>
* build: tms470: work around glibc math.h problemsMans Rullgard2012-10-13
| | | | | | | The glibc definitions of INFINITY and NAN do not work with the tms470 compiler, nor do our usual fallbacks. Signed-off-by: Mans Rullgard <mans@mansr.com>
* compat/vsnprintf: return number of bytes required on truncation.Ronald S. Bultje2012-09-15
| | | | | | This conforms to C99, but requires Windows >= XP. Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
* lavu: add snprintf(), vsnprint() and strtod() replacements for MS runtime.Ronald S. Bultje2012-09-05
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* getopt: Remove an unnecessary defineMartin Storsjö2012-08-16
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* getopt: Add missing includesMartin Storsjö2012-08-16
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* dct/fft-test: use a replacement getopt() if the system has none present.Ronald S. Bultje2012-07-11
This allows compiling and running these tests on systems lacking a built- in version of getopt(), such as MSVC. Signed-off-by: Anton Khirnov <anton@khirnov.net>