stb icon indicating copy to clipboard operation
stb copied to clipboard

Make stdint.h optional, allow to provide own type definitions

Open mupfdev opened this issue 2 years ago • 4 comments

Is your feature request related to a problem? Please describe. I'm actively developing a game for a legacy system. The compiler does not provide stdint.h, which seems to be a requirement for stb_image.h.

Describe the solution you'd like It would be great if the library would offer the possibility to use own type definitions.

mupfdev avatar Apr 19 '22 14:04 mupfdev

stb_image already HAS a path that uses its own type definitions. It is currently conditioned on compiling with Microsoft Visual C. You need to identify a preprocessor symbol we can use to identify your legacy compiler/platform.

nothings avatar Apr 19 '22 15:04 nothings

Hi! I don't know if it makes sense to introduce a separate symbol for the preprocessor for each platform. This could certainly be done more generically. But if that is what is wanted, I would be happy to give it a try.

mupfdev avatar Apr 19 '22 16:04 mupfdev

It doesn't make sense to me to put it on a generic #define that the user can flip, because then every user of the library has to write their own code to set it appropriately, and if they are cross-platform they may have to write conditional definitions. There are a lot more users then there are platforms, so it makes more sense for us to do the more complicated conditional work once than for every user to do it themselves.

nothings avatar Apr 19 '22 16:04 nothings

Touché! I'll try to make it work on Symbian and send a PR ASAP.

mupfdev avatar Apr 19 '22 17:04 mupfdev

Fixed in 2.28.

rygorous avatar Jan 29 '23 23:01 rygorous