Fix SCU global namespace conflict in resource_format_text.cpp
#96511
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
FORMAT_VERSION
is used in multiple places in the codebase, and #defining it was causing conflicts.Notes
FORMAT_VERSION
in enums afterresource_format_text.cpp
has #defined it.FORMAT_VERSION
in local enums, which is safer for making sure the correct version is used.FORMAT_VERSION_COMPAT
and_printerr()
weren't causing build errors for me, but seemed worth fixing at the same time.In general
#define
should be used with care due to the potential for conflicts with global namespace (and the use of contrived naming may be recommended for defines). This applies not just in SCU builds.The alternative here would have been to exclude the problematic
.cpp
from the SCU build inscene/resources/SCsub
, but in this case it looks more sensible to fix the unnecessary use of global namespace, which may fix more bugs in the long run.