Skip to content

Commit

Permalink
AVRO-3959: [C] Avoid deprecated OSX atomic ops (apache#2797)
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
SahilKang authored and Ranbir Kumar committed May 13, 2024
1 parent a83277a commit 1485a35
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lang/c/src/avro/refcount.h
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand Down

0 comments on commit 1485a35

Please sign in to comment.