-
Notifications
You must be signed in to change notification settings - Fork 476
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cstdio name collision solution #74
base: master
Are you sure you want to change the base?
Conversation
Codecov Report
@@ Coverage Diff @@
## master #74 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 1 1
Lines 359 359
=========================================
Hits 359 359
Continue to review full report at Codecov.
|
Hi Patrik, |
trailing underscore is not a problem, macros like Error:
/*line 18*/ #include "printf/printf.h"
/*line 19*/ #include <cstdio> If I swap them, error is different:
|
With this wrap workaround, you have to include normal printf headers ( |
Uiii, I see, the macro defines create problems. Unusual, but existent. |
I am open to suggestion for improvements, like styling etc. Also some note about this problem and how to solve it should be put somewhere. Readme or comment in code? When someone want to use wrapping method in c++, should we suggest to directly include |
default names are mp_printf etc. to rename to epic_printf, add compiler arg: `-D'PRINTF_FUNCTION_RENAME\(base\)=epic_\#\#base'` (example taken from cmake, character escaping might differ)
A have new way of name collision avoidance. Function names are prefixed by default by |
…printf.h` prototypes are now `static`, and will not raise any eyebrows when the resulting object is inspected.
I had issues with name collision when including
cstdio
#66. Solution with mapping to wrap functions is taken from bisqwit/tinyprintf. What do you think about it?Consider this a quick POC rather than a final code solution.