Add printf formatting macros for nk data types
Adds macros from formatting the nk data types
| Macro | Type |
|---|---|
| NK_FMT_CHAR | nk_char |
| NK_FMT_UCHAR | nk_uchar |
| NK_FMT_BYTE | nk_byte |
| NK_FMT_SHORT | nk_short |
| NK_FMT_USHORT | nk_ushort |
| NK_FMT_INT | nk_int |
| NK_FMT_UINT | nk_uint |
| NK_FMT_SIZE | nk_size |
| NK_FMT_PTR | nk_ptr |
This won't completely prevent issues like #727 but it should help.
Needs to be tested on Windows.
Here's a test program to check for warnings.
https://gist.github.com/PROP65/88cf2ec23a5052350f2e79857dd9fd8e
Seems like a good solution. Those warnings have been pretty annoying in the build sometimes.
IS this good to go, now?
Is this really necessary?
Nuklear does not depend on exact-int-size printf formatting anywhere in its sources, only demos and examples really need it. There is roughly one place in a library where a simple formatting (%s/%d/%f/etc) is being used, and this PR is not even applying to it. Demos/examples are relaxed from C89 rule and there would be nothing wrong if you simply include <inttypes.h> somewhere inside of demo/common/overview.c. In fact most of those already require C99, and this is even mentioned here. Adding all those macros into library headers brings so much complexity and possible issues. I don't believe it's worth it.
@RobLoach Don't get me wrong, but I don't think this should be ever merged. The linked issue (https://github.com/Immediate-Mode-UI/Nuklear/issues/727) is only about demo/common/overview.c. Fixing it by adding all those symbols to the library is an over-kill.