From 1595c42b9aec9b5eef02a24f01d01411842d1901 Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Wed, 26 Feb 2020 09:07:39 -0800 Subject: [PATCH] CNIOAtomics: define types for `uintptr_t` and `intptr_t` (#1401) On LLP64 hosts, `Int` is mapped to `intptr_t` and `UInt` to `uintptr_t`. As a result, we need to ensure that we map the atomic extensions to those types for type conversions. Add the types for `uintptr_t` and `intptr_t` so that they can be used to implement `CNIOConcurrencyHelpers` on Windows. Co-authored-by: Johannes Weiss --- Sources/CNIOAtomics/include/CNIOAtomics.h | 3 +++ Sources/CNIOAtomics/src/c-atomics.c | 3 ++- Sources/CNIOAtomics/src/c-nioatomics.c | 3 ++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Sources/CNIOAtomics/include/CNIOAtomics.h b/Sources/CNIOAtomics/include/CNIOAtomics.h index 007b192d..2f353c7a 100644 --- a/Sources/CNIOAtomics/include/CNIOAtomics.h +++ b/Sources/CNIOAtomics/include/CNIOAtomics.h @@ -70,4 +70,7 @@ DECLARE_ATOMIC_OPERATIONS(uint_least32_t, uint_least32_t) DECLARE_ATOMIC_OPERATIONS(int_least64_t, int_least64_t) DECLARE_ATOMIC_OPERATIONS(uint_least64_t, uint_least64_t) +DECLARE_ATOMIC_OPERATIONS(intptr_t, intptr_t) +DECLARE_ATOMIC_OPERATIONS(uintptr_t, uintptr_t) + #undef DECLARE_ATOMIC_OPERATIONS diff --git a/Sources/CNIOAtomics/src/c-atomics.c b/Sources/CNIOAtomics/src/c-atomics.c index db5e8d0e..f946e9ae 100644 --- a/Sources/CNIOAtomics/src/c-atomics.c +++ b/Sources/CNIOAtomics/src/c-atomics.c @@ -81,5 +81,6 @@ MAP(MAKE,EMPTY, int_least8_t, uint_least8_t, int_least16_t, uint_least16_t, int_least32_t, uint_least32_t, - int_least64_t, uint_least64_t + int_least64_t, uint_least64_t, + intptr_t, uintptr_t ) diff --git a/Sources/CNIOAtomics/src/c-nioatomics.c b/Sources/CNIOAtomics/src/c-nioatomics.c index 22402434..b306df6e 100644 --- a/Sources/CNIOAtomics/src/c-nioatomics.c +++ b/Sources/CNIOAtomics/src/c-nioatomics.c @@ -71,5 +71,6 @@ MAP(MAKE,EMPTY, int_least8_t, uint_least8_t, int_least16_t, uint_least16_t, int_least32_t, uint_least32_t, - int_least64_t, uint_least64_t + int_least64_t, uint_least64_t, + intptr_t, uintptr_t )