-
Notifications
You must be signed in to change notification settings - Fork 70
Make the code compile with clang-cl in VS22 #888
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
base: main
Are you sure you want to change the base?
Conversation
@@ -590,7 +590,7 @@ void WWProfileManager::End_Collecting(const char* filename) | |||
if (name[i]==',') name[i]='.'; | |||
if (name[i]==';') name[i]=':'; | |||
} | |||
str.Format("ID: %d %s\r\n",ite.Peek_Value(),name); | |||
str.Format("ID: %d %s\r\n",ite.Peek_Value(),name.Peek_Buffer()); |
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.
Correct way to get a C string from StringClass is to use static_cast<const char *>(name)
to invoke the conversion operator.
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.
I'd like to hear from one or more other contributors on this because I think consistency is a valid counter point.
@@ -32,7 +32,7 @@ | |||
#define IUNKNOWN_NOEXCEPT | |||
#endif | |||
|
|||
#if __cplusplus >= 201103L | |||
#if __cplusplus >= 201103L && !defined(__clang__) |
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.
This doesn't sit right with me, cland-cl should be able to handle these constructs in C++11 or greater.
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.
I couldn't really figure out what was going on, frankly, I think clang-cl doesn't like forward declared enums with fixed underlying type, but that doesn't really make sense to me.
@@ -172,19 +172,19 @@ void W3DMainMenuDraw( GameWindow *window, WinInstanceData *instData ) | |||
IRegion2D topHorizontal1 ={pos.x, pos.y, pos.x + size.x, pos.y }; | |||
IRegion2D topHorizontal1drop ={pos.x, pos.y+1, pos.x + size.x, pos.y+1 }; | |||
|
|||
IRegion2D topHorizontal2 ={pos.x, pos.y + (size.y * .1) , pos.x + size.x, pos.y + (size.y * .1) }; | |||
IRegion2D topHorizontal2drop ={pos.x, pos.y + (size.y * .12) , pos.x + size.x, pos.y + (size.y * .12) }; | |||
IRegion2D topHorizontal2 ={pos.x, pos.y + static_cast<Int>(size.y * .1) , pos.x + size.x, pos.y + static_cast<Int>(size.y * .1) }; |
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.
Doesn't this change the way the maths is done? Originally the values in parenthesis would be implictly promoted to double and then the addition done using double precision as well before final conversion back to Int. Now the addition will be done using integer addition.
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.
I'll look into this.
For the GameSpy SDK issue, you can log the issue or create a PR for it at https://github.com/TheAssemblyArmada/GamespySDK and then PR bumping the version that is fetched here. At a glance it looks like the macros to take the "Unix" path aren't hit so |
I'm making this a draft for the time being because there are some things that still need doing:
clang-cl
. There seems to be an issue around the macrova_arg
which gets a different definition withclang-cl
.clang-cl
, and the compiler setting needs to be changed for that flag.I have only resolved the compiler errors for
g_generals
,z_generals
and dependencies for both projects.