nothings / stb

stb single-file public domain libraries for C/C++
https://twitter.com/nothings
Other
26.84k stars 7.72k forks source link

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

Closed mupfdev closed 1 year ago

mupfdev commented 2 years ago

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.

nothings commented 2 years ago

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.

mupfdev commented 2 years ago

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.

nothings commented 2 years ago

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.

mupfdev commented 2 years ago

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

rygorous commented 1 year ago

Fixed in 2.28.