Each of the functions below (add, sub, and, or, xor) return the value that was in the memory location before the operation occurred.
| 111 | // Each of the functions below (add, sub, and, or, xor) return the value that |
| 112 | // was in the memory location before the operation occurred. |
| 113 | _EM_INLINE uint8_t emscripten_atomic_add_u8(void /*uint8_t*/* _Nonnull addr, uint8_t val) { |
| 114 | return __c11_atomic_fetch_add((_Atomic uint8_t*)addr, val, __ATOMIC_SEQ_CST); |
| 115 | } |
| 116 | _EM_INLINE uint16_t emscripten_atomic_add_u16(void /*uint16_t*/* _Nonnull addr, uint16_t val) { |
| 117 | return __c11_atomic_fetch_add((_Atomic uint16_t*)addr, val, __ATOMIC_SEQ_CST); |
| 118 | } |