restructure nlr.h for undefined archtectures #2216
Merged
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.
This PR is by no means critical - there may be better ways to do this
Background
I was attempting to build CP on a Raspberry Pi with Ubuntu 19.04 installed - just to see if it worked...
When I tried to build mpy-cross - it failed with several instances of this error
The Ubuntu distribution on RPi uses the architecture "aarch64" which is not recognized by nlr.h. This should not necessarily be a problem, but as written nlr.h attempts to redefine MICROPY_NLR_SETJMP if the architecture is not recognized.
This PR just restructures the tests so it is only defined once.
With this change, the build of mpy-cross succeeds.
This change has no impact on the BSP builds other than providing a working mpy-cross.
After all taht, it is not clear there is a real need to be able to build under Ubuntu on an RPi since the build tools work fine under Raspian Buster.
The main reason for this change is to fix a potential error when unrecognized architectures are used. nlr.h should not try to redefine MICROPY_NLR_SETJMP.
I think this is a "harmless" change to avoid that.
Note: I also did a little "clean up" of the indentation to make the section more readable.