proposal: additional prefix to avoid name collision
diggit opened this issue · 3 comments
diggit commented
I propose to add prefix to all exposed functions using eg. macro. This is to avoid possible name collision with stdio and other libraries when used.
What do you think?
mpaland commented
All exposed functions end with _
, and there are defines which define the function name, e.g.
#define printf printf_
int printf_(const char* format, ...);
So IMHO there won't be a function name collision.
ryanwinter commented
I noticed that it does an:
#undef printf
which results in a linker error when it tries to pull the global printf into the std namespace:
toolchain-xtensa32\xtensa-esp32-elf\include\c++\5.2.0\cstdio:127:11: error: '::printf' has not been declared
I don't understand why it can't find the original printf defined in stdio.h, but the is included by a 3rd party library.