Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Imath includes shall be guarded #1582

Open
sanguinariojoe opened this issue Oct 17, 2023 · 1 comment
Open

Imath includes shall be guarded #1582

sanguinariojoe opened this issue Oct 17, 2023 · 1 comment
Labels
Enhancement A request for a change or enhancement.

Comments

@sanguinariojoe
Copy link
Contributor

sanguinariojoe commented Oct 17, 2023

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.
@meshula meshula added the Enhancement A request for a change or enhancement. label Oct 20, 2023
@meshula
Copy link
Contributor

meshula commented Oct 20, 2023

That would be a good thing to address, thanks for pointing it out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement A request for a change or enhancement.
Projects
None yet
Development

No branches or pull requests

2 participants