Skip to content

Msvc standard compliance#379

Merged
texus merged 3 commits into
texus:1.xfrom
jjuhl:msvc-standard-compliance
Jun 3, 2026
Merged

Msvc standard compliance#379
texus merged 3 commits into
texus:1.xfrom
jjuhl:msvc-standard-compliance

Conversation

@jjuhl
Copy link
Copy Markdown
Contributor

@jjuhl jjuhl commented Jun 3, 2026

No description provided.

jjuhl added 3 commits June 3, 2026 05:27
Enforce the C++11 rule that all functions declared inline must have a
definition available in the same translation unit if they're used.
@jjuhl
Copy link
Copy Markdown
Contributor Author

jjuhl commented Jun 3, 2026

Ok, so it seems clang-cl doesn't understand /Zc:enumTypes - should I just drop that last commit or special case msvc vs clang-cl? Or just drop this entire branch? The intention here is to get msvc to behave as standard compliant as possible so we can in general just go by what the language standard specifies and worry less about compiler differences.

@texus
Copy link
Copy Markdown
Owner

texus commented Jun 3, 2026

If I understand what /Zc:enumTypes does correctly, then I'm not sure if it is a good idea for enabling it when building TGUI even with MSVC. It feels like this is an option that needs to be set for all dependencies in your project as well, otherwise you risk binary incompatibility (e.g. the implementation and calling code use a different size for the function parameter).

The other options don't cause such potential issues so they are fine.
Technically the /Zc:__cplusplus option also alters how the header looks like when compiling TGUI vs when compiling the final project, but the headers should never use __cplusplus in cases where this would cause an issue (the TGUI_COMPILED_WITH_CPP_VER define exists for these cases).

@jjuhl jjuhl force-pushed the msvc-standard-compliance branch from 363e7d4 to 3b2bca9 Compare June 3, 2026 17:04
@jjuhl
Copy link
Copy Markdown
Contributor Author

jjuhl commented Jun 3, 2026

Right, good point. I dropped that commit.

@texus texus merged commit 0719d9e into texus:1.x Jun 3, 2026
15 checks passed
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

Successfully merging this pull request may close these issues.

2 participants