Commit 66572ed7 authored by Felix Abecassis's avatar Felix Abecassis Committed by Jean-Baptiste Kempf

vlc_atomic: set the atomic types to be at least 32 bits wide with MSVC.

This change is required since some atomic operations of the
Interlocked API are only available for desktop apps.
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent 5ff29f80
......@@ -57,6 +57,18 @@
* unsigned equivalents, i.e. 4-bytes and 8-bytes types, although GCC also
* supports 1 and 2-bytes types. Some non-x86 architectures do not support
* 8-byte atomic types (or not efficiently). */
# if defined (_MSC_VER)
/* Some atomic operations of the Interlocked API are only
available for desktop apps. Thus we define the atomic types to
be at least 32 bits wide. */
typedef int_least32_t atomic_flag;
typedef int_least32_t atomic_bool;
typedef int_least32_t atomic_char;
typedef int_least32_t atomic_schar;
typedef uint_least32_t atomic_uchar;
typedef int_least32_t atomic_short;
typedef uint_least32_t atomic_ushort;
# else
typedef bool atomic_flag;
typedef bool atomic_bool;
typedef char atomic_char;
......@@ -64,6 +76,7 @@ typedef signed char atomic_schar;
typedef unsigned char atomic_uchar;
typedef short atomic_short;
typedef unsigned short atomic_ushort;
# endif
typedef int atomic_int;
typedef unsigned int atomic_uint;
typedef long atomic_long;
......
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