Skip to content

Rename symbols for standard library compatibility#9

Open
diddyholz wants to merge 2 commits into
SnailMath:masterfrom
diddyholz:stdlib_compatibility
Open

Rename symbols for standard library compatibility#9
diddyholz wants to merge 2 commits into
SnailMath:masterfrom
diddyholz:stdlib_compatibility

Conversation

@diddyholz
Copy link
Copy Markdown

Currently, the SDK is not compatible with a C standard library due to it using some symbols such as "open", "write", "memset". This hinders development and therefore I suggest to rename all conflicting functions, structs and enums to use some form of Prefix to distinguish them from the standard library.

In my branch I added the header name as the prefix, as it is already done in LCD.h or MCS.h. I am open to other naming suggestions as well.

I also added a link to my port of newlib in the "development" documentation.

@TheRainbowPhoenix
Copy link
Copy Markdown
Collaborator

I think it should be better to find other ways. As considered :

  • Lephe told about .weak

.weak s make symbol s weak, which has the effect that at link time if you have two definitions the non-weak definition overrides the weak one
Or __attribute__((weak)) in C/C++

  • QBoss07 told about alias

aliases is something to consider too. .set name1, name2 in asm and somehting like __attribute__((target)) in C/C++

It also seems to be possible to do "both", could be interesting to have an updated PR on that

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.

2 participants