mirror of
https://git.openafs.org/openafs.git
synced 2025-01-31 21:47:45 +00:00
Define OSATOMIC_USE_INLINED to get usable atomics on DARWIN
In Mac OS 10.12, legacy interfaces for atomic operations have been deprecated. Defining OSATOMIC_USE_INLINED gets us inline implementations of the OSAtomic interfaces in terms of the <stdatomic.h> primitives. This is a transition convenience. Also indent preprocessor directives within the main DARWIN block to improve readability. Change-Id: Id10ae007d5427486f1b0a307a04a90f263201150 Reviewed-on: https://gerrit.openafs.org/12433 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
This commit is contained in:
parent
f5f057ce81
commit
74f837fd94
@ -184,14 +184,21 @@ rx_atomic_test_and_clear_bit(rx_atomic_t *atomic, int bit) {
|
||||
|
||||
#elif defined(AFS_DARWIN80_ENV) || defined(AFS_USR_DARWIN80_ENV)
|
||||
|
||||
#include <libkern/OSAtomic.h>
|
||||
#if defined(KERNEL) && !defined(UKERNEL)
|
||||
#define OSAtomicIncrement32 OSIncrementAtomic
|
||||
#define OSAtomicAdd32 OSAddAtomic
|
||||
#define OSAtomicDecrement32 OSDecrementAtomic
|
||||
#define OSAtomicOr32 OSBitOrAtomic
|
||||
#define OSAtomicAnd32 OSBitAndAtomic
|
||||
#endif
|
||||
# if defined (AFS_DARWIN160_ENV) || defined(AFS_USR_DARWIN160_ENV)
|
||||
# define OSATOMIC_USE_INLINED 1
|
||||
# else
|
||||
|
||||
# if defined(KERNEL) && !defined(UKERNEL)
|
||||
# define OSAtomicIncrement32 OSIncrementAtomic
|
||||
# define OSAtomicAdd32 OSAddAtomic
|
||||
# define OSAtomicDecrement32 OSDecrementAtomic
|
||||
# define OSAtomicOr32 OSBitOrAtomic
|
||||
# define OSAtomicAnd32 OSBitAndAtomic
|
||||
# endif
|
||||
|
||||
# endif /* end defined DARWIN160 */
|
||||
|
||||
# include <libkern/OSAtomic.h>
|
||||
|
||||
typedef struct {
|
||||
volatile int var;
|
||||
|
Loading…
x
Reference in New Issue
Block a user