From 1485a3582d3b47775c49600707243d569e56b68f Mon Sep 17 00:00:00 2001 From: Sahil Kang Date: Tue, 12 Mar 2024 00:48:06 -0700 Subject: [PATCH] AVRO-3959: [C] Avoid deprecated OSX atomic ops (#2797) macOS 10.12 deprecated the OSAtomic* functions. This removes the following warnings: warning: 'OSAtomicIncrement32' is deprecated: first deprecated in macOS 10.12 warning: 'OSAtomicDecrement32' is deprecated: first deprecated in macOS 10.12 Signed-off-by: Sahil Kang Signed-off-by: Sahil Kang --- lang/c/src/avro/refcount.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lang/c/src/avro/refcount.h b/lang/c/src/avro/refcount.h index 27369900ab9..fd431f3ccea 100644 --- a/lang/c/src/avro/refcount.h +++ b/lang/c/src/avro/refcount.h @@ -86,7 +86,10 @@ avro_refcount_dec(volatile int *refcount) * Mac OS X */ -#elif __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1050 +#elif __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1050 \ + && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 101200 + +/* macOS 10.12 deprecates OSAtomic* so we'll use the GCC/Clang branch below */ #include