Get every language preprocessor conditional into one library#378
Merged
majcosta merged 21 commits intoDec 31, 2024
Conversation
442dcdd to
d135913
Compare
d135913 to
82dd4b2
Compare
b4e2100 to
196a4e0
Compare
Contributor
Author
|
probably better to merge rather than rebase this one |
gather all ENGLISH|GERMAN|CHINESE etc preprocessor hell into a single library, so to restrict the number of targets that need to be built 8x this still has UB/EDITOR definitions so that still needs to be dealt with before we can build it only 8 times
it has preprocessor silliness in it
this might cause a horrifying alignment bug, but I doubt it
eventually we'll switch between CHINESE and other languages during runtime, so even if language is not chinese, these symbols must still be there these symbol names aren't used so this is fine
This one is big, but unless I missed something, should be all be
trivial.
scripted-diff with the following, then manually tweaked whatever needed:
```
if [ $# -ne 3 ]; then
echo "Usage: $0 '<pattern>' '<replacement>' '<filename>'"
exit 1
fi
pattern="$1"
replacement="$2"
filename="$3"
if [ ! -f "$filename" ]; then
echo "Error: File $filename does not exist."
exit 1
fi
sed -i '/'"$pattern"'/ {
:loop
$ !{
N
/'"$pattern"'.*\n.*#endif/ {
s/'"$pattern"'/'"$replacement"'/
s/#else/} else {/
s/#endif/}/
P
D
}
/'"$pattern"'/ b loop
}
}' "$filename"
echo "Replacement complete in $filename"
```
h/t to Grok2 for the sed command
A bit clunkier, had to repeat function calls because of how preprocessor tricks don't map 1:1 with actual C++.
It's where all conditional language preprocessor goes
Never use relative paths for #includes. Didn't touch the rest because out of scope.
This function is just for GERMAN but it has a unique name so it's no problem. Had to slightly change how MercID gets populated
these seem to be right, chinese text appears to be flowing correctly
because magically I got the enum order right first try
has language preprocessor silliness, straight to jail
196a4e0 to
9fd8c3f
Compare
Language is now just built once per app (still some JA2UB conditionals going on in there) but building everything should now take eight times less work
9fd8c3f to
959c294
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
cuts down compilation quite a bit, down to around ~2960 translation units from 17k to build everything