-
Notifications
You must be signed in to change notification settings - Fork 921
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
Compile mpqapi.cpp as C #554
Conversation
Does the C compiler have const? |
Yes const can be applied to variables. |
Not sure why you're removing all the consts since they have no bearing on C++ -> C, plus it does break binary exactness. pfile_encode_hero() calls mpqapi_write_file() with a literal constant string "hero", by removing the const specifier from the function definition that string can't be passed as a pointer to .rdata (which is what the original code does). |
That's a good point. DIdn't know exactly how the compiler decides which segment to put string literal in. |
@AJenbo would mpqapi.cpp also compile with the consts? If so, lets keep them. Was there any other issues that prevent us from compiling this file with |
As described in #528; compiling mpqapi.cpp as C was causing the compiler to emit some errors. Looking at it I found that the issue was introduced in this commit e2adda1 where the |
Ah, that makes sense. Thanks! |
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.
LGTM.
Bin exactness of the file is not affected.