Compare commits

...

3 Commits

Author SHA1 Message Date
Ryan Schmidt bdb1f4b2b9
Fix typos in comments (#57) 2022-11-19 23:52:37 -05:00
Ryan Schmidt b8d17f4481
Don't overwrite user-specified CFLAGS and CXXFLAGS (#51)
* Check C and C++ compiler separately

It's possible (however unlikely) that the C++ compiler might be clang
but the C compiler might not be.

* Don't overwrite user-specified CFLAGS and CXXFLAGS
2022-11-19 22:32:44 -05:00
Ryan Schmidt a76287876c
Add error message when loader can't load command (#55)
And change exit code from EX_CONFIG to EX_SOFTWARE.
2022-11-19 22:14:57 -05:00
3 changed files with 19 additions and 6 deletions

View File

@ -10,9 +10,13 @@ set(CMAKE_C_STANDARD_REQUIRED TRUE)
set(CMAKE_C_EXTENSIONS FALSE)
if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
# Clang or AppleClang
set(CMAKE_CXX_FLAGS "-Wall ${CMAKE_CXX_FLAGS}")
endif()
if ("${CMAKE_C_COMPILER_ID}" MATCHES "Clang")
# Clang or AppleClang
set(CMAKE_CXX_FLAGS "-Wall")
set(CMAKE_C_FLAGS "-Wall")
set(CMAKE_C_FLAGS "-Wall ${CMAKE_C_FLAGS}")
endif()

View File

@ -957,10 +957,19 @@ int main(int argc, char **argv)
#ifdef LOADER_LOAD
uint16_t err = Loader::Native::LoadFile(command);
if (err) exit(EX_CONFIG);
if (err) {
const char *cp = ErrorName(err);
fprintf(stderr, "Unable to load command %s: ", command.c_str());
if (cp) printf("%s\n", cp);
else printf("%hd\n", err);
exit(EX_SOFTWARE);
}
#else
uint32_t address = load(command.c_str());
if (!address) exit(EX_CONFIG);
if (!address) {
fprintf(stderr, "Unable to load command %s\n", command.c_str());
exit(EX_SOFTWARE);
}
#endif
GlobalInit();

View File

@ -83,8 +83,8 @@ namespace OS {
{
char buffer[PATH_MAX + 1];
// FSSpecs are valid for non-existant files
// but not non-existant directories.
// FSSpecs are valid for non-existent files
// but not non-existent directories.
// realpath does not behave in such a manner.
// expand the path. Also handles relative paths.