cpu/atmega_common: Provide C++ support (without libstdc++)#14598
Merged
benpicco merged 4 commits intoRIOT-OS:masterfrom Jul 27, 2020
Merged
cpu/atmega_common: Provide C++ support (without libstdc++)#14598benpicco merged 4 commits intoRIOT-OS:masterfrom
benpicco merged 4 commits intoRIOT-OS:masterfrom
Conversation
For thread-safe calling of C++ constructs of statically allocated class instances some platform support code is needed. This commit ads one implementation compatible with g++.
Contributor
|
Murdock isn't happy yet. |
Member
Author
Thanks for pointing this out. I think I fixed the culprit. May I squash before Murdock takes a second look? |
Contributor
|
Sure, squash! |
The C++ header cstdio is used, but only provided by libstdc++
Member
|
Requeueing to get the release out ASAP. |
Contributor
|
Looks like utensor also requires libstdcpp |
benpicco
approved these changes
Jul 27, 2020
Contributor
benpicco
left a comment
There was a problem hiding this comment.
Code looks good and tests/cpp_ctors is working on AVR.
Member
Author
|
Thanks for the review! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Contribution description
This PR adds basic C++ support, including support for initializing statically allocated class instances in a thread-safe manner. (The implementation of the later is not AVR specific, so it was moved as module to
sys/. Other architectures might just use that as well.)Testing procedure
All of the C++ tests in
tests/should work, except those requiring libstdc++ support. (But those should complain about a missing feature, instead of surprising compilation bugs.)Issues/PRs references
None