Skip to content

Improve chunk source file support for cross-platform builds#9

Merged
benstone merged 8 commits into
benstone:mainfrom
mcayland:fix/chunkfile-cross-platform
Oct 18, 2025
Merged

Improve chunk source file support for cross-platform builds#9
benstone merged 8 commits into
benstone:mainfrom
mcayland:fix/chunkfile-cross-platform

Conversation

@mcayland
Copy link
Copy Markdown
Contributor

This series comes from an experimental branch to try and build 3DMMEx on other platforms and solves two main problems when attempting to build on Linux:

  • Use forward slashes instead of backslashes in file paths
  • Fix filename case to allow build on a case-sensitive filesystem

The most interesting part of this series is that it appears the backslashes are currently escaped incorrectly when filenames are embedded with the output chunk file, e.g.

Before:

00389630  73 74 75 64 69 6f 63 75  72 72 65 70 6f 73 69 74  |studiocurreposit|
00389640  69 2e 63 75 72 00 00 00  00 52 43 47 47 66 00 00  |i.cur....RCGGf..|
00389650  00 ec 00 00 00 06 5d 00  00 00 00 00 00 03 03 15  |......].........|
00389660  73 74 75 64 69 6f 63 75  72 73 71 75 61 73 68 73  |studiocursquashs|
00389670  74 2e 63 75 72 00 00 00  00 52 43 47 47 67 00 00  |t.cur....RCGGg..|
00389680  00 49 01 00 00 06 71 00  00 00 00 00 00 03 03 15  |.I....q.........|
00389690  73 74 75 64 69 6f 63 75  72 73 69 7a 65 76 65 6e  |studiocursizeven|
003896a0  6c 2e 63 75 72 00 00 00  00 52 43 47 47 68 00 00  |l.cur....RCGGh..| 

After:

00389630  00 a4 dc 01 00 ff ff ff  ff 14 00 00 00 52 43 47  |.............RCG|
00389640  47 65 00 00 00 80 00 00  00 06 6c 00 00 00 00 00  |Ge........l.....|
00389650  00 03 03 17 73 74 75 64  69 6f 2f 63 75 72 2f 72  |....studio/cur/r|
00389660  65 70 6f 73 69 74 69 2e  63 75 72 00 00 52 43 47  |epositi.cur..RCG|
00389670  47 66 00 00 00 ec 00 00  00 06 5d 00 00 00 00 00  |Gf........].....|
00389680  00 03 03 17 73 74 75 64  69 6f 2f 63 75 72 2f 73  |....studio/cur/s|
00389690  71 75 61 73 68 73 74 2e  63 75 72 00 00 52 43 47  |quashst.cur..RCG|
003896a0  47 67 00 00 00 49 01 00  00 06 71 00 00 00 00 00  |Gg...I....q.....|
003896b0  00 03 03 17 73 74 75 64  69 6f 2f 63 75 72 2f 73  |....studio/cur/s|
003896c0  69 7a 65 76 65 6e 6c 2e  63 75 72 00 00 52 43 47  |izevenl.cur..RCG|

When attempting to build the chunk files on Linux, chomp fails unless the
target container directory exists.
Since Linux uses a case-sensitive filesystem, the engine include directory
must also be in lower case in order to locate the include files.
GCC fails to parse the #error directives containing apostrophes unless they are
surrounded by double quotes.
…lenames

This allows any include and file paths to work correctly both on Windows and
non-Windows platforms.
…filenames

This allows any include and file paths to work correctly both on Windows and
non-Windows platforms.
…ilenames

This allows any include and file paths to work correctly both on Windows and
non-Windows platforms.
…names

This allows any include and file paths to work correctly both on Windows and
non-Windows platforms.
…lenames

This allows any include and file paths to work correctly both on Windows and
non-Windows platforms.
@benstone benstone merged commit 9bb8251 into benstone:main Oct 18, 2025
1 check passed
@benstone
Copy link
Copy Markdown
Owner

Thanks!

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