This is an automated email from the ASF dual-hosted git repository.

mgrigorov pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/avro.git


The following commit(s) were added to refs/heads/main by this push:
     new 01ba73caf AVRO-3959: [C] Avoid deprecated OSX atomic ops (#2797)
01ba73caf is described below

commit 01ba73caf4c003e1de159889602453822e49c8f8
Author: Sahil Kang <[email protected]>
AuthorDate: Tue Mar 12 00:48:06 2024 -0700

    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 <[email protected]>
    Signed-off-by: Sahil Kang <[email protected]>
---
 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 27369900a..fd431f3cc 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 <libkern/OSAtomic.h>
 

Reply via email to