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

Fix compilation issues caused by far identifier #95768

Merged
merged 1 commit into from
Aug 19, 2024

Conversation

AThousandShips
Copy link
Member

@AThousandShips AThousandShips commented Aug 18, 2024

Breaks some builds on Win due to macro use of this name

Did a search and there doesn't seem to be any other cases like this, with regex of \bfar( =|;|,)

It might be possible to declare our own macro for this to enforce failing when introducing identifiers like this, will see if I can make something work (that also doesn't break things)

@AThousandShips
Copy link
Member Author

AThousandShips commented Aug 18, 2024

@Anutrix I don't have a MinGW setup that works right now (correction, I don't have anything set up for building the editor with MinGW), can you confirm that the engine builds with this PR? See here for instructions for checking out a PR

@Anutrix
Copy link
Contributor

Anutrix commented Aug 19, 2024

@Anutrix I don't have a MinGW setup that works right now (correction, I don't have anything set up for building the editor with MinGW), can you confirm that the engine builds with this PR? See here for instructions for checking out a PR

@AThousandShips Yes. It works with the changes in this MR. Thx.

Also, just curious how you found out that far is a macro in Windows environments. 'far' being too short and a very common word makes it hard to find any info about it.

@alvinhochun
Copy link
Contributor

far and also near are for compatibility with old code. Back in the 16-bit era there was the distinction between near pointers and far pointers, nowadays long gone, but of course MS still has them in the Windows headers. Which mingw-w64 headers follow suit.

I don't understand why the MSVC CI build doesn't catch this though. Shouldn't it be causing the same issue there?

Breaks some builds on Win due to macro use of this name
@akien-mga akien-mga merged commit 7a4a6fb into godotengine:master Aug 19, 2024
18 checks passed
@akien-mga
Copy link
Member

Thanks!

@AThousandShips AThousandShips deleted the fix_far branch August 19, 2024 10:25
@AThousandShips
Copy link
Member Author

Thank you!

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