firmware: support compiling on SDCC >=4.0.3 #70
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.
Hi, as per issue #67 the SDCC compiler renamed
_itoa
,_uitoa
,_ltoa
and_ultoa
to__itoa
,__uitoa
,__ltoa
and__ultoa
respectively.This patch converts the only two calls I can find (both in
printfl.c
) to the new__
syntax, and adds a few preprocessor directives tocompiler_defs.h
to alias the__
versions to their old names in revisions of SDCC below the point where this was changed.If it's desirable to maintain compatibility with compilers other than
sdcc
it may be worth doing this the other way around, or with a proper macro - happy to change that if you like - but this way seemed the least fraught with peril.This builds with both SDCC 4.1.0 (latest release) and SDCC 3.8.0 (current Ubuntu Focal package) based on my own testing.