Skip to content
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

Fix building QVMs on Linux with Windows line endings #628

Merged
merged 1 commit into from
Dec 27, 2023

Conversation

zturtleman
Copy link

@zturtleman zturtleman commented Dec 27, 2023

On non-Windows, compiling QVM tools failed if dagcheck.md had CRLF line endings and compiling QVMs failed if game source had CRLF line endings.

Also made Windows open the files as binary (no automatic CRLF to LF) so it behaves the same as on non-Windows.


If code/tools/lcc/src/dagcheck.md has CRLF line endings, fails to compile QVM tools.

LBURG code/tools/lcc/src/dagcheck.md
line 1: invalid character `%'
line 1: invalid character `{'
line 1: invalid character `\015'
line 2: invalid character `#'
line 2: syntax error
line 2: invalid character `\015'
line 3: syntax error
line 3: invalid character `;'
line 3: invalid character `\015'
...

If QVM tools compiled but game source has CRLF line endings, it fails to compile.

CGAME_Q3LCC code/cgame/cg_main.c
cpp: code/cgame/cg_main.c:24 Syntax error in #include
cpp: code/cgame/cg_main.c:26 Syntax error in #ifdef/#ifndef
cpp: code/cgame/cg_main.c:68 Syntax error in #ifdef/#ifndef
cpp: code/cgame/cg_main.c:161 Syntax error in #ifdef/#ifndef
cpp: code/cgame/cg_main.c:178 Syntax error in #ifdef/#ifndef
cpp: code/cgame/cg_main.c:189 Syntax error in #ifdef/#ifndef
cpp: code/cgame/cg_main.c:269 Syntax error in #ifdef/#ifndef
cpp: code/cgame/cg_main.c:271 Syntax error in #else
cpp: code/cgame/cg_main.c:273 Syntax error in #endif
...

On non-Windows, compiling QVM tools failed if dagcheck.md had CRLF line
endings and compiling QVMs failed if game source had CRLF line endings.

Also made Windows open the files as binary (no automatic CRLF to LF) so
it behaves the same as on non-Windows.
@zturtleman zturtleman merged commit 5ede35d into ioquake:main Dec 27, 2023
3 checks passed
@zturtleman zturtleman deleted the linux-crlf branch December 27, 2023 04:26
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.

1 participant