Skip to content

Commit

Permalink
vlc_atomic: set the atomic types to be at least 32 bits wide with MSVC.
Browse files Browse the repository at this point in the history
This change is required since some atomic operations of the
Interlocked API are only available for desktop apps.

Signed-off-by: Jean-Baptiste Kempf <[email protected]>
  • Loading branch information
flx42 authored and jbkempf committed Jan 3, 2014
1 parent 5ff29f8 commit 66572ed
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions include/vlc_atomic.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,26 @@
* 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;
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;
Expand Down

0 comments on commit 66572ed

Please sign in to comment.