Cameron Gutman 509a36db16 atomic: Fix missing full memory barrier on GCC/Clang
__sync_lock_test_and_set() is designed for creating locks, not as
a general atomic exchange function. As a result, it only provides
an acquire memory barrier and isn't guaranteed to actually store
the provided value (though it does on architectures we care about).

__atomic_exchange_n() is supported on GCC/Clang for the last ~10
years, so let's use that instead if available. We will keep the
__sync_lock_test_and_set() fallback around for ancient platforms,
but add a full memory barrier to match the documented behavior.
2026-04-19 06:34:45 -04:00
2026-04-05 18:33:22 +00:00

Simple DirectMedia Layer (SDL for short) is a cross-platform library designed to make it easy to write multi-media software, such as games and emulators.

You can find the latest release and additional information at: https://www.libsdl.org/

Installation instructions and a quick introduction is available in INSTALL.md

This library is distributed under the terms of the zlib license, available in LICENSE.txt.

Enjoy!

Sam Lantinga (slouken@libsdl.org)

S
Description
Simple Directmedia Layer
Readme 205 MiB
Languages
C 85.6%
C++ 6.6%
Objective-C 3.3%
CMake 1.7%
Python 0.7%
Other 1.8%