Skip to content

Commit

Permalink
shims: adopt _os_atomic_auto_dependency from osfmk
Browse files Browse the repository at this point in the history
This adds the missing shim for atomics from osfmk to allow usage of
`_os_atomic_auto_dependency.
  • Loading branch information
compnerd committed Nov 12, 2021
1 parent adb3f6e commit 7b7b063
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/shims/atomic.h
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,11 @@

typedef struct { unsigned long __opaque_zero; } os_atomic_dependency_t;

#define _os_atomic_auto_dependency(e) \
_Generic(e, \
os_atomic_dependency_t: (e), \
default: os_atomic_make_dependency(e))

#define OS_ATOMIC_DEPENDENCY_NONE ((os_atomic_dependency_t){ 0UL })
#define os_atomic_make_dependency(v) ((void)(v), OS_ATOMIC_DEPENDENCY_NONE)
#define os_atomic_inject_dependency(p, e) \
Expand Down

0 comments on commit 7b7b063

Please sign in to comment.