stb_image is used to load images in various example/* and demo/* examples.
There's currently two different stb_image versions, where example/stb_image.h is v2.08 and demo/common/filebrowser/stb_image.h is v2.28.
stb_image also isn't compatible with C89 because of the C++ style comments.
Would it make sense to create a single stb_image file with the latest version (2.30) that is compatible with C89?
Activity
30Yeah, optimally we'd update example/stb_image.h to the latest with C89 compatibility.
Yeah, optimally we'd update example/stb_image.h to the latest with C89 compatibility.
Yeah, optimally we'd update example/stb_image.h to the latest with C89 compatibility.
Yeah, optimally we'd update example/stb_image.h to the latest with C89 compatibility.
Yeah, optimally we'd update example/stb_image.h to the latest with C89 compatibility.
Yeah, optimally we'd update example/stb_image.h to the latest with C89 compatibility.
Yeah, optimally we'd update example/stb_image.h to the latest with C89 compatibility.
Yeah, optimally we'd update example/stb_image.h to the latest with C89 compatibility.
from https://github.com/Immediate-Mode-UI/Nuklear/issues/895#issuecomment-3891208097
demos using stb_image [...] wont compile with pedantic on c89 (because using features from more recent standard)
IIRC those were mostly caused by C++ comments
//and upstream didn't want to fix it (nothings/stb#1328). I remember writing some POSIX AWK script for replacing//and preserving their logical structure (but I don't remember where I put it, so I'll probably have to start over...)
I can probably write up some script for fetching, replacing comments, and applying our patches to all stb libraries. This would help with issues such as https://github.com/Immediate-Mode-UI/Nuklear/pull/905#issuecomment-3978787904 where the changes are being repeatedly lost.
Maybe we can add new folder for all those vendored libraries? ./ven ? ./deps ? This would make it more clear and scalable, since we're already considering GLAD addition (https://github.com/Immediate-Mode-UI/Nuklear/pull/777), and I've seen few other PRs where it would help (e.g. https://github.com/Immediate-Mode-UI/Nuklear/pull/664, https://github.com/Immediate-Mode-UI/Nuklear/pull/902)
What do you guys think?
Yeah. vendor them, though may want a readme since it's essentially a fork for the C89 support.
Yeah. vendor them, though may want a readme since it's essentially a fork for the C89 support.
Yeah. vendor them, though may want a readme since it's essentially a fork for the C89 support.
Yeah. vendor them, though may want a readme since it's essentially a fork for the C89 support.
I made a start on this in https://github.com/Immediate-Mode-UI/Nuklear/pull/956, but might have jumped the gun after reading this more carefully..Sorry @sleeptightAnsiC, I missed your comment about potentially having a generic script to replace C++ comments for various other files used in Nuklear.
My approach is a bit more complicated than the simple re.sub(r"//(.*)(\n|$)", "/* \\1 */\\2", str) one-liner in the header packer script! I think this results in nicer comments but might be overkill. Replacing comments also has some annoying edge cases, so my script might not work correctly for other files.
I'll keep my PR as a draft so you can at least take a look and let me know the best way to proceed.
I made a start on this in https://github.com/Immediate-Mode-UI/Nuklear/pull/956, but might have jumped the gun after reading this more carefully..Sorry @sleeptightAnsiC, I missed your comment about potentially having a generic script to replace C++ comments for various other files used in Nuklear.
My approach is a bit more complicated than the simple re.sub(r"//(.*)(\n|$)", "/* \\1 */\\2", str) one-liner in the header packer script! I think this results in nicer comments but might be overkill. Replacing comments also has some annoying edge cases, so my script might not work correctly for other files.
I'll keep my PR as a draft so you can at least take a look and let me know the best way to proceed.
I made a start on this in https://github.com/Immediate-Mode-UI/Nuklear/pull/956, but might have jumped the gun after reading this more carefully..Sorry @sleeptightAnsiC, I missed your comment about potentially having a generic script to replace C++ comments for various other files used in Nuklear.
My approach is a bit more complicated than the simple re.sub(r"//(.*)(\n|$)", "/* \\1 */\\2", str) one-liner in the header packer script! I think this results in nicer comments but might be overkill. Replacing comments also has some annoying edge cases, so my script might not work correctly for other files.
I'll keep my PR as a draft so you can at least take a look and let me know the best way to proceed.
I made a start on this in https://github.com/Immediate-Mode-UI/Nuklear/pull/956, but might have jumped the gun after reading this more carefully..Sorry @sleeptightAnsiC, I missed your comment about potentially having a generic script to replace C++ comments for various other files used in Nuklear.
My approach is a bit more complicated than the simple re.sub(r"//(.*)(\n|$)", "/* \\1 */\\2", str) one-liner in the header packer script! I think this results in nicer comments but might be overkill. Replacing comments also has some annoying edge cases, so my script might not work correctly for other files.
I'll keep my PR as a draft so you can at least take a look and let me know the best way to proceed.
I made a start on this in https://github.com/Immediate-Mode-UI/Nuklear/pull/956, but might have jumped the gun after reading this more carefully..Sorry @sleeptightAnsiC, I missed your comment about potentially having a generic script to replace C++ comments for various other files used in Nuklear.
My approach is a bit more complicated than the simple re.sub(r"//(.*)(\n|$)", "/* \\1 */\\2", str) one-liner in the header packer script! I think this results in nicer comments but might be overkill. Replacing comments also has some annoying edge cases, so my script might not work correctly for other files.
I'll keep my PR as a draft so you can at least take a look and let me know the best way to proceed.
I made a start on this in https://github.com/Immediate-Mode-UI/Nuklear/pull/956, but might have jumped the gun after reading this more carefully..Sorry @sleeptightAnsiC, I missed your comment about potentially having a generic script to replace C++ comments for various other files used in Nuklear.
My approach is a bit more complicated than the simple re.sub(r"//(.*)(\n|$)", "/* \\1 */\\2", str) one-liner in the header packer script! I think this results in nicer comments but might be overkill. Replacing comments also has some annoying edge cases, so my script might not work correctly for other files.
I'll keep my PR as a draft so you can at least take a look and let me know the best way to proceed.
Yeah, optimally we'd update example/stb_image.h to the latest with C89 compatibility.