Build kauai and chomp on Linux, allowing release .chk files identical to those on Windows to be built#12
Merged
Conversation
benstone
reviewed
Nov 22, 2025
This allows the main() function to be compiled on both Windows and non-Windows platforms.
This also requires the relevant callers to be updated because the cast logic in the KWND class requires nullptr if the owner is unspecified.
…on-Windows platforms This includes an implementation for platlinux.cpp.
This is a new FNI implementation for POSIX systems making use of the C++17 std::filesystem library which we include when building on Linux.
This is a new file implementation for POSIX systems which we include when building on Linux.
For platforms that are not (Classic) Mac, use the same behaviour as for the Windows platform.
For platforms that are not (Classic) Mac, use the same behaviour as for the Windows platform except without generating the OutputDebugString() output.
For platforms that are not (Classic) Mac, use the same behaviour as for the Windows platform.
…SWMEVENT For now ignore any SDL_SYSWMEVENTs on non-Windows platforms.
This function is used by the Windows-specific portfolio code and is not used on non-Windows platforms.
The HDC variable is unused and so can simply be removed.
Replace the Windows-specific byte type with the cstdint standard uint8_t type.
Replace the Windows-specific BOOL type with the cstdint standard bool type.
Thw Windows-specific _hnExport variable is not used on non-Windows platforms.
Also update kauai/CMakeLists.txt so that ctl.cpp is built for all platforms.
This is currently a set of stubs to allow the file to compile since there is no native metafile format for POSIX systems. Update kauai/CMakeLists.txt so that the file is used when building on non-Windows platforms.
This allows the khello app to compile and link on Linux.
…s target GCC must be invoked using different flags in order to generate pre-processor output.
The existing options parser doesn't work correctly if filenames begin with a forward slash since it is assumed that anything following the forward slash will always be a command line option. Adjust the parser so that only arguments that begin with a forward slash and have a length of 2 characters are considered to be command line options.
…tforms The native C implementation can be used for platforms that are not (Classic) Mac or Windows.
For platforms that are not (Classic) Mac, use the same behaviour as for the Windows platform.
…or non-Windows platforms Use the definitions from the MIT-licensed libBMpp https://github.com/veeso/libBMpp/ and information from Wikipedia as a basis to provide an alternative to Windows in-built definitions.
When attempting to parse whitespace within the input file, ensure that the line ending is detected correctly on both Windows and non-Windows platforms.
… input file When processing an input file, lex.cpp uses the embedded pre-processor source file information to track the current file and line position. The MSVC pre-processor generates source file information in the form "#line <num> <filename>" whilst the gcc pre-processor generates source file information in the form "# <n> <filename> <flags>". Adjust LEXB::_FSkipWhiteSpace() so that it can handle both MSVC and gcc embedded pre-processor source file information.
a8a1352 to
9ba681d
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.
This series finishes the changes required to build kauai on Linux, followed by fixing up the chunk compiler
chompso that it is possible to build release .chk files identical to those on Windows via thestudio-chomp-chunkstarget.In particular this requires the addition of new
fniposix.cppandfileposix.cppimplementations written using C++17std::filesystemthat can be used for POSIX systems. The rest of the changes are fairly straightforward, however it is worth noting the changes tokauai/src/lex.cppto include support for parsing pre-processor files generated from gcc which is needed to track source file position in the chunk compiler.