diff --git a/CMakeLists.txt b/CMakeLists.txt index 447c806..1fb2912 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,13 +21,13 @@ if (APPLE) elseif("${CMAKE_SYSTEM_NAME}" MATCHES "SunOS") set(CMAKE_C_COMPILER "gcc") set(CMAKE_CXX_COMPILER "g++") - set(CMAKE_CXX_FLAGS "-std=c++14 -Wall -g") - set(CMAKE_C_FLAGS "-std=c99 -Wall -g") + set(CMAKE_CXX_FLAGS "-std=c++14 -Wall -g -Wno-unknown-pragmas") + set(CMAKE_C_FLAGS "-std=c99 -Wall -g") elseif("${CMAKE_SYSTEM_NAME}" MATCHES "Linux") set(CMAKE_C_COMPILER "gcc") set(CMAKE_CXX_COMPILER "g++") - set(CMAKE_CXX_FLAGS "-std=c++14 -Wall -g") - set(CMAKE_C_FLAGS "-std=c99 -Wall -g") + set(CMAKE_CXX_FLAGS "-std=c++14 -Wall -g -Wno-unknown-pragmas") + set(CMAKE_C_FLAGS "-std=c99 -Wall -g") elseif("${CMAKE_SYSTEM_NAME}" MATCHES "Windows") endif() diff --git a/config.h b/config.h new file mode 100644 index 0000000..3e5e887 --- /dev/null +++ b/config.h @@ -0,0 +1,28 @@ +#ifndef __mpw_config_h__ +#define __mpw_config_h__ + +#ifdef __APPLE__ + #include + + #define HAVE_STAT_ST_BIRTHTIME + #define HAVE_DIRENT_D_NAMLEN + +#endif + +#ifdef __sun__ +#include + + +#endif + + +#ifdef __linux__ +#include + +#endif + +#ifdef _WIN32 + +#endif + +#endif diff --git a/toolbox/dispatch.cpp b/toolbox/dispatch.cpp index c522618..7192340 100644 --- a/toolbox/dispatch.cpp +++ b/toolbox/dispatch.cpp @@ -54,6 +54,8 @@ #include #include +#include + // yuck. TST.W d0 extern "C" void cpuSetFlagsNZ00NewW(UWO res); @@ -102,7 +104,7 @@ namespace { #if BYTE_ORDER == LITTLE_ENDIAN inline constexpr uint16_t host_to_big_endian_16(uint16_t x) { - return __builtin_bswap16(x); + return (x << 8) | (x >> 8); // __builtin_bswap16(x); } #endif diff --git a/toolbox/os_hfs_dispatch.cpp b/toolbox/os_hfs_dispatch.cpp index 88e9230..fd531f7 100644 --- a/toolbox/os_hfs_dispatch.cpp +++ b/toolbox/os_hfs_dispatch.cpp @@ -55,6 +55,8 @@ #include "stackframe.h" #include "fs_spec.h" +#include + #include using ToolBox::Log; @@ -381,6 +383,8 @@ namespace OS { } #ifdef HAVE_DIRENT_D_NAMLEN if (dir->d_namlen > 255) continue; // too long! +#else + if (strlen(dir->d_name) > 255) continue; #endif if (--ioFDirIndex == 0) break; }