openexr
openexr copied to clipboard
Imath includes shall be guarded
trafficstars
You are many times doing dangerous includes:
https://github.com/AcademySoftwareFoundation/openexr/blob/main/src/lib/OpenEXRCore/internal_coding.h#L24
While you should do the guarded version:
#include <Imath/half.h>
There are 2 main reasons that make your way suboptimal:
- Collisions. How many projects can have a half.h header file? Any other project with such a file, which is either not guarding the header or including it like you do, will cause a collision
- Exotic makefiles. With CMake this is not a big deal (or maybe it is...), but it is definitely a pain in the ass on other building systems. It is indeed impossible to use Imath when installed on a custom folder.
That would be a good thing to address, thanks for pointing it out.