stb
stb copied to clipboard
Make fallthroughs explicit in stb_image.h
trafficstars
The -Wimplicit-fallthrough flag can be used to check for implicit fallthroughs, which are a common source of errors.
I've added and used STBI_FALLTHROUGH which maps to __attribute__((fallthrough)), which the compiler uses to determine whether a fallthrough is explicit or not.
This needs to work on all compilers, so the define needs to be an ifdef which tests for suitable compilers, with an else that defines it to nothing.
@nothings - Of course, my apologies. I've updated the PR.