summaryrefslogtreecommitdiff
path: root/compat/atomics
Commit message (Collapse)AuthorAge
* atomics: Fix the win32 atomic_exchange functionMartin Storsjö2021-04-04
| | | | | | | | | | This fixes building with MSVC after a2a38b160620d91bc3f895dadc4501c589998b9c. Remove the stray semicolon, and add casts for the input argument (which is an intptr_t*) to the right type (PVOID volatile *). Signed-off-by: Martin Storsjö <martin@martin.st>
* Merge commit '6a93b596c5c3af31b843d63013a7985ffeea354d'James Almer2017-04-13
|\ | | | | | | | | | | | | * commit '6a93b596c5c3af31b843d63013a7985ffeea354d': compat/atomics: add typecasts in atomic_compare_exchange_strong() Merged-by: James Almer <jamrial@gmail.com>
| * 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>
| * 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
* stdatomic/win32: only include the lean windows headers to avoid conflictsHendrik Leppkes2017-04-04
|
* compat/atomics: fix atomic_fetch_xorJames Almer2017-04-02
|
* compat/atomics/gcc: use __typeof__ instead of typeofJames Almer2017-03-18
| | | | | | | | | The typeof keyword is apparently not available when using the -std=c99 option. Fixes the use of C11 atomic functions with old GCC. Reviewed-by: Muhammad Faiz <mfcc64@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* compat/atomics: rename header guardsJames Almer2016-12-02
| | | | | | Fixes fate-source. Signed-off-by: James Almer <jamrial@gmail.com>
* Add a compat dummy stdatomic.h used when threading is disabledAnton Khirnov2016-12-02
| | | | | | | | | | Adapted from the code by Rémi Denis-Courmont from VLC This merges libav commit eb34d40354e2474517c9b9bd787e0dadc89c2a81. Signed-off-by: Wan-Teh Chang <wtc@google.com> Reviewed-by: wm4 <nfxjfg@googlemail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* Add a compat stdatomic.h implementation based on pthreadsAnton Khirnov2016-12-02
| | | | | | | | | | Adapted from the code by Rémi Denis-Courmont from VLC This merges libav commit f9a6a80e065cdb95b233978f1d96ec9bc863daa1. Signed-off-by: Wan-Teh Chang <wtc@google.com> Reviewed-by: wm4 <nfxjfg@googlemail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* Add a compat stdatomic.h implementation based on suncc atomicsAnton Khirnov2016-12-02
| | | | | | | | | | Adapted from the code by Rémi Denis-Courmont from VLC This merges libav commit bb81ed476569b912a37ed553e756e123b6b13b14. Signed-off-by: Wan-Teh Chang <wtc@google.com> Reviewed-by: wm4 <nfxjfg@googlemail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* Add a compat stdatomic.h implementation based on windows atomicsAnton Khirnov2016-12-02
| | | | | | | | | | Adapted from the code by Rémi Denis-Courmont from VLC This merges libav commit c2755864afadfbaa349e8d583665c86fe99fa90b. Signed-off-by: Wan-Teh Chang <wtc@google.com> Reviewed-by: wm4 <nfxjfg@googlemail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* Add a compat stdatomic.h implementation based on GCC atomicsAnton Khirnov2016-12-02
Adapted from the code by Rémi Denis-Courmont from VLC This merges libav commit 4e928ef340ac20325f529d92fcbc51e768085358. Signed-off-by: Wan-Teh Chang <wtc@google.com> Reviewed-by: wm4 <nfxjfg@googlemail.com> Signed-off-by: James Almer <jamrial@gmail.com>