zhangyu-duck opened a new pull request, #19868:
URL: https://github.com/apache/nuttx/pull/19868

   ## Summary
   
   Switch `<nuttx/atomic.h>` to call toolchain builtin atomic functions 
directly (`__atomic_*` / `__c11_atomic_*` / `_Interlocked*`), avoiding 
conflicts with third-party C/C++ standard libraries that include 
`<atomic>`/`<stdatomic.h>`.
   
   Rename `atomic_fetch_xxx` -> `atomic_xxx` (e.g., `atomic_fetch_add` -> 
`atomic_add`) because the `atomic_fetch_xxx` naming is reserved by the C/C++ 
standard and conflicts with standard library declarations. Other non-standard 
API names (`atomic_read`, `atomic_set`, `atomic_xchg`) remain unchanged.
   
   Use `_Atomic` qualifier for `atomic_t` typedef when supported, with a 
`__Atomic(t)` wrapper for clang/C++ compatibility.
   
   ## Breaking change
   
   This is a breaking API change. A companion PR in the apps tree renames call 
sites (`atomic_fetch_add` -> `atomic_add`, etc.).
   
   ## Stacked PR chain
   
   Depends on #19867. This is PR 3 of 3:
   - #19866: atomic.h header fixes
   - #19867: multi-backend atomic implementation
   - PR 3 (this): toolchain builtin atomic + API rename
   
   ## Test
   
   CI testbuild across ARM/RISC-V/SIM targets.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to