-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
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
Rename camera near
and far
private members to avoid conflict with Windows.h
defines
#87164
Conversation
These could alternatively be undefined with other things in |
That won't work. While you can remove the min/max defs from Windows.h with |
This PR could also remove this snippets I had to add to some places precisely for the root issue being addressed here:
Those wouldn't be needed anymore. |
Don't think these can simply be removed in other locations. Atleast the couple where I found this macro there were local variables called near and far . So it would require a lot more refactoring to get rid of all of those |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense to me. Those are private members so it doesn't break compat for C++ modules.
near
and far
private members to avoid conflict with Windows.h
defines
Could you amend the commit message to be more explicit, e.g. like I renamed the PR? This would prevent confusion about this possibly renaming the actual exposed
Would be nice to do as a follow-up PR if you're interested. |
Done.
Will do once I find time for that. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@akien-mga This might require compatibility methods so we don't change the existing api for Camera3D. I am not very familiar with compatibility methods to guide.
These are private member variables in the c++ class, not exposed properties |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If they're private apis, that's fine.
Thanks! |
This comment was marked as off-topic.
This comment was marked as off-topic.
You alright mate? This is not even about |
Sadly
Windows.h
defines macros for bothnear
andfar
so naming variables like this, especially in header files is causing a lot of issues. As soon as any file includesWindows.h
beforecamera_3d.h
your build will simply fail. Whilecamera_3d.h
does already include undefs for mingw builds this is insufficient as those macros are used in other parts of the windows headers as well.This PR simply renames
Camera3D::far
andCamera3D::near
toCamera3D::camera_far
andCamera3D::camera_near
to avoid this issue alltogether. Since all public methods stay the same this shouldn't cause any downstream issues.