1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

cpu/native: Fix C11 atomic sizes for musl

musl and glibc have different types for fast atomic integers. This
selects the correct size depending on the used library.
This commit is contained in:
Marian Buschsieweke 2024-06-05 22:02:26 +02:00
parent 70f5747712
commit 21151691d7
No known key found for this signature in database
GPG Key ID: 77AA882EC78084E6

View File

@ -63,24 +63,24 @@
#define ATOMIC_UINT_FAST8_T_SIZE (1U)
#define ATOMIC_UINT_FAST8_T_SAME_SIZED_TYPE uint8_t
#endif
#ifdef __x86_64__
#define ATOMIC_INT_FAST16_T_SIZE (8U)
#define ATOMIC_INT_FAST16_T_SAME_SIZED_TYPE uint64_t
#define ATOMIC_UINT_FAST16_T_SIZE (8U)
#define ATOMIC_UINT_FAST16_T_SAME_SIZED_TYPE uint64_t
#define ATOMIC_INT_FAST32_T_SIZE (8U)
#define ATOMIC_INT_FAST32_T_SAME_SIZED_TYPE uint64_t
#define ATOMIC_UINT_FAST32_T_SIZE (8U)
#define ATOMIC_UINT_FAST32_T_SAME_SIZED_TYPE uint64_t
#if defined(__x86_64__) && defined(__GLIBC__)
# define ATOMIC_INT_FAST16_T_SIZE (8U)
# define ATOMIC_INT_FAST16_T_SAME_SIZED_TYPE uint64_t
# define ATOMIC_UINT_FAST16_T_SIZE (8U)
# define ATOMIC_UINT_FAST16_T_SAME_SIZED_TYPE uint64_t
# define ATOMIC_INT_FAST32_T_SIZE (8U)
# define ATOMIC_INT_FAST32_T_SAME_SIZED_TYPE uint64_t
# define ATOMIC_UINT_FAST32_T_SIZE (8U)
# define ATOMIC_UINT_FAST32_T_SAME_SIZED_TYPE uint64_t
#else
#define ATOMIC_INT_FAST16_T_SIZE (4U)
#define ATOMIC_INT_FAST16_T_SAME_SIZED_TYPE uint32_t
#define ATOMIC_UINT_FAST16_T_SIZE (4U)
#define ATOMIC_UINT_FAST16_T_SAME_SIZED_TYPE uint32_t
#define ATOMIC_INT_FAST32_T_SIZE (4U)
#define ATOMIC_INT_FAST32_T_SAME_SIZED_TYPE uint32_t
#define ATOMIC_UINT_FAST32_T_SIZE (4U)
#define ATOMIC_UINT_FAST32_T_SAME_SIZED_TYPE uint32_t
# define ATOMIC_INT_FAST16_T_SIZE (4U)
# define ATOMIC_INT_FAST16_T_SAME_SIZED_TYPE uint32_t
# define ATOMIC_UINT_FAST16_T_SIZE (4U)
# define ATOMIC_UINT_FAST16_T_SAME_SIZED_TYPE uint32_t
# define ATOMIC_INT_FAST32_T_SIZE (4U)
# define ATOMIC_INT_FAST32_T_SAME_SIZED_TYPE uint32_t
# define ATOMIC_UINT_FAST32_T_SIZE (4U)
# define ATOMIC_UINT_FAST32_T_SAME_SIZED_TYPE uint32_t
#endif
#define ATOMIC_INT_FAST64_T_SIZE (8U)
#define ATOMIC_INT_FAST64_T_SAME_SIZED_TYPE uint64_t