Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

openamp/libmetal: Check CONFIG_HAVE_ATOMICS instead of HAVE_STDATOMIC_H in atomic.h #9760

Merged
merged 1 commit into from
Jul 10, 2023

Conversation

wengzhe
Copy link
Contributor

@wengzhe wengzhe commented Jul 10, 2023

Summary

When we use libmetal with other headers using stdatomic.h, we'll get symbol conflict if we don't enable HAVE_STDATOMIC_H in libmetal. The best solution might be using cmake to detect headers automatically, but we can't. Fortunately we have CONFIG_HAVE_ATOMICS macro now, which can replace HAVE_STDATOMIC_H when we're not using cmake.

Note: 2-Steps to use CONFIG_HAVE_ATOMICS

  1. Include nuttx/compiler.h for CONFIG_HAVE_ATOMICS definition
  2. Check CONFIG_HAVE_ATOMICS instead of HAVE_STDATOMIC_H

Impact

config.h and atomic.h in libmetal

Testing

CI

…_H in atomic.h

When we use libmetal with other headers using stdatomic.h, we'll get
symbol conflict if we don't enable HAVE_STDATOMIC_H in libmetal.  The
best solution might be using cmake to detect headers automatically, but
we can't.  Fortunately we have CONFIG_HAVE_ATOMICS macro now, which can
replace HAVE_STDATOMIC_H when we're not using cmake.

Note: 2-Steps to use CONFIG_HAVE_ATOMICS
1. Include compiler.h for CONFIG_HAVE_ATOMICS definition
2. Check CONFIG_HAVE_ATOMICS instead of HAVE_STDATOMIC_H

Signed-off-by: Zhe Weng <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants