tinycc/include
kbkpbot 36ff4f52b5
Some checks failed
build and test / test-x86_64-linux (push) Has been cancelled
build and test / test-x86_64-osx (push) Has been cancelled
build and test / test-aarch64-osx (push) Has been cancelled
build and test / test-x86-win32 (push) Has been cancelled
build and test / test-armv7-linux (push) Has been cancelled
build and test / test-aarch64-linux (push) Has been cancelled
build and test / test-riscv64-linux (push) Has been cancelled
Add GCC-style atomic builtins: __atomic_*_n
This commit adds GCC-compatible atomic builtins to stdatomic.h for
better compatibility with code relying on GCC's atomic primitives.

1. ​**​New Macros​**​:
   - `__atomic_compare_exchange_n`.
   - `__atomic_load_n`.
   - `__atomic_store_n`.

2. ​**​Motivation​**​:
   - Improves compatibility with codebases using GCC's atomic builtins
     directly.
   - Simplifies atomic operations by allowing direct value passing
     (instead of pointers), enhancing code readability.
   - Aligns TCC's atomic support closer to GCC/Clang for cross-compiler
     projects.

3. ​**​Testing​**​:
   - Verified with basic test cases (integer CAS, load/store) on x86.
   - Confirmed no regressions in existing atomic operations.

- This change does not affect existing C11 `atomic_*` APIs.
- Struct types are intentionally unsupported in `_n` variants due to
  complexity.
2025-04-19 08:05:27 +08:00
..
float.h Define LDBL_MAX_10_EXP for aarch64, riscv 2024-12-12 18:25:20 -08:00
stdalign.h add C11 stdalign.h header 2019-09-08 15:04:06 +03:00
stdarg.h stdarg: always have the __builtin_va_* available 2020-04-15 22:06:52 +02:00
stdatomic.h Add GCC-style atomic builtins: __atomic_*_n 2025-04-19 08:05:27 +08:00
stdbool.h stdbool.h: Make conformant to ISOC99 2014-04-07 00:30:31 +02:00
stddef.h Only define alloca on i386/x86_64 2022-04-12 07:07:40 +02:00
stdnoreturn.h C11 conformance: Add _Noreturn, stdnoreturn.h, and partial _Alignas support 2019-03-20 15:03:27 -04:00
tccdefs.h Revert "Fix tcc -run on Windows" (almost) 2025-03-26 20:36:20 +01:00
tgmath.h Overhauled WIN32 math and added missing functions: 2020-11-20 23:34:35 +01:00
varargs.h win64: use new headers from mingw 2009-07-18 22:06:37 +02:00