Commit Graph

18 Commits

Author SHA1 Message Date
L. E. Segovia ddc1cd5cdd configure: Set WIN32_LEAN_AND_MEAN at configure time
Including winsock2.h or windows.h without WIN32_LEAN_AND_MEAN cause
bzlib.h to parse as nonsense, due to an instance of #define char small
in rpcndr.h.

See:

https://stackoverflow.com/a/27794577

Signed-off-by: L. E. Segovia <amy@amyspark.me>
Signed-off-by: Martin Storsjö <martin@martin.st>
2023-08-14 22:57:28 +03:00
Martin Storsjö b1b7cc698b atomics: Fix the win32 atomic_exchange function
This fixes building with MSVC after
a2a38b1606.

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>
2021-04-04 11:06:08 +03:00
James Almer eab5d29810 Merge commit '6a93b596c5c3af31b843d63013a7985ffeea354d'
* commit '6a93b596c5c3af31b843d63013a7985ffeea354d':
  compat/atomics: add typecasts in atomic_compare_exchange_strong()

Merged-by: James Almer <jamrial@gmail.com>
2017-04-13 18:27:20 -03:00
Hendrik Leppkes 9ac1e88436 stdatomic/win32: only include the lean windows headers to avoid conflicts 2017-04-04 09:33:23 +02:00
James Almer 7942907878 compat/atomics: fix atomic_fetch_xor 2017-04-02 00:57:17 -03:00
James Almer 824d4062a1 compat/atomics/gcc: use __typeof__ instead of typeof
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>
2017-03-18 12:13:46 -03:00
Wan-Teh Chang 6a93b596c5 compat/atomics: add typecasts in atomic_compare_exchange_strong()
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>
2016-12-08 15:53:58 -05:00
James Almer f88c8e0dc3 compat/atomics: rename header guards
Fixes fate-source.

Signed-off-by: James Almer <jamrial@gmail.com>
2016-12-02 20:08:54 -03:00
Anton Khirnov 41e891e89e Add a compat dummy stdatomic.h used when threading is disabled
Adapted from the code by Rémi Denis-Courmont from VLC

This merges libav commit eb34d40354.

Signed-off-by: Wan-Teh Chang <wtc@google.com>
Reviewed-by: wm4 <nfxjfg@googlemail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2016-12-02 16:25:18 -03:00
Anton Khirnov 74b5f10862 Add a compat stdatomic.h implementation based on pthreads
Adapted from the code by Rémi Denis-Courmont from VLC

This merges libav commit f9a6a80e06.

Signed-off-by: Wan-Teh Chang <wtc@google.com>
Reviewed-by: wm4 <nfxjfg@googlemail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2016-12-02 16:25:18 -03:00
Anton Khirnov 70faadc826 Add a compat stdatomic.h implementation based on suncc atomics
Adapted from the code by Rémi Denis-Courmont from VLC

This merges libav commit bb81ed4765.

Signed-off-by: Wan-Teh Chang <wtc@google.com>
Reviewed-by: wm4 <nfxjfg@googlemail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2016-12-02 16:25:18 -03:00
Anton Khirnov c91e72ed52 Add a compat stdatomic.h implementation based on windows atomics
Adapted from the code by Rémi Denis-Courmont from VLC

This merges libav commit c2755864af.

Signed-off-by: Wan-Teh Chang <wtc@google.com>
Reviewed-by: wm4 <nfxjfg@googlemail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2016-12-02 16:25:17 -03:00
Anton Khirnov 3359eede8f Add a compat stdatomic.h implementation based on GCC atomics
Adapted from the code by Rémi Denis-Courmont from VLC

This merges libav commit 4e928ef340.

Signed-off-by: Wan-Teh Chang <wtc@google.com>
Reviewed-by: wm4 <nfxjfg@googlemail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2016-12-02 16:25:17 -03:00
Anton Khirnov eb34d40354 Add a compat dummy stdatomic.h used when threading is disabled
Adapted from the code by Rémi Denis-Courmont from VLC
2016-10-02 18:57:56 +02:00
Anton Khirnov f9a6a80e06 Add a compat stdatomic.h implementation based on pthreads
Adapted from the code by Rémi Denis-Courmont from VLC
2016-10-02 18:56:52 +02:00
Anton Khirnov bb81ed4765 Add a compat stdatomic.h implementation based on suncc atomics
Adapted from the code by Rémi Denis-Courmont from VLC
2016-10-02 18:55:41 +02:00
Anton Khirnov c2755864af Add a compat stdatomic.h implementation based on windows atomics
Adapted from the code by Rémi Denis-Courmont from VLC
2016-10-02 18:54:28 +02:00
Anton Khirnov 4e928ef340 Add a compat stdatomic.h implementation based on GCC atomics
Adapted from the code by Rémi Denis-Courmont from VLC
2016-10-02 18:52:08 +02:00