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

<Math> header undefines macros #1354

Closed
Teskann opened this issue Jan 16, 2025 · 1 comment
Closed

<Math> header undefines macros #1354

Teskann opened this issue Jan 16, 2025 · 1 comment

Comments

@Teskann
Copy link

Teskann commented Jan 16, 2025

Hello,

I would like to spot an issue regarding the include file:
https://github.com/openscenegraph/OpenSceneGraph/blob/2e4ae2ea94595995c1fc56860051410b0c0be605/include/osg/Math#L25C1-L34C35

Image

Indeed, you undefine some macros, so that you can use PI, PI_2, PI_4 identifiers for your constants.

This is a bug source. These #undef directives might cause conflicts with third party code that would be included before osg (read more).
I suggest you rename your pi constants with another case, (as recommended in CPP core guidelines) and remove the #undef directives to avoid potentially interfering with user code.

Cheers,

@robertosfield
Copy link
Collaborator

I don't recall the original reasons but the OSG has had a looong life and tricks like these were likely essential to handle some problem compile/header/platform combinations. The OSG is in maintenance mode so we aren't chasing the perfect way.

For any modern application work please don't use the OSG, use a modern API like the OSG's successor the VuklanSceneGraph.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants