diff --git a/src/CompilerSupport/filesystem.h b/src/CompilerSupport/filesystem.h index 55bbbd0..b85463d 100644 --- a/src/CompilerSupport/filesystem.h +++ b/src/CompilerSupport/filesystem.h @@ -1,9 +1,11 @@ #pragma once -#if defined(__cplusplus) && __cplusplus >= 201703L && defined(__has_include) && __has_include() +#if !__APPLE__ /* don't use built-in filesystem implementation so we can support older macOS versions */ && \ +defined(__cplusplus) && __cplusplus >= 201703L && defined(__has_include) && __has_include() #include namespace fs = std::filesystem; #else + #define LEGACY_FILESYSTEM_IMPLEMENTATION 1 #include "CompilerSupport/filesystem_implementation.hpp" namespace fs = ghc::filesystem; #endif diff --git a/src/Files/Files.cpp b/src/Files/Files.cpp index 7c7787e..21e06af 100644 --- a/src/Files/Files.cpp +++ b/src/Files/Files.cpp @@ -19,7 +19,7 @@ using namespace Pomme::Files; #define LOG POMME_GENLOG(POMME_DEBUG_FILES, "FILE") -constexpr int MAX_VOLUMES = 32767; // vRefNum is a signed short +//constexpr int MAX_VOLUMES = 32767; // vRefNum is a signed short -- commented out for now because we only have one volume //----------------------------------------------------------------------------- // State diff --git a/src/Files/HostVolume.cpp b/src/Files/HostVolume.cpp index d5c0472..4ab837c 100644 --- a/src/Files/HostVolume.cpp +++ b/src/Files/HostVolume.cpp @@ -151,6 +151,18 @@ OSErr HostVolume::OpenFork(const FSSpec* spec, ForkType forkType, char permissio bool isAppleDoubleFile; } candidates[] = { +#if LEGACY_FILESYSTEM_IMPLEMENTATION + // "._NAME": ADF contained in zips created by macOS's built-in archiver + { "._" + specName, true }, + + // "NAME.rsrc": ADF extracted from StuffIt/CompactPro archives by unar + { specName + ".rsrc", true }, + +#if __APPLE__ + // "NAME/..namedfork/rsrc": macOS-specific way to access true resource forks (not ADF) + { specName + "/..namedfork/rsrc", false }, +#endif +#else // "._NAME": ADF contained in zips created by macOS's built-in archiver { u8"._" + specName, true }, @@ -160,6 +172,7 @@ OSErr HostVolume::OpenFork(const FSSpec* spec, ForkType forkType, char permissio #if __APPLE__ // "NAME/..namedfork/rsrc": macOS-specific way to access true resource forks (not ADF) { specName + u8"/..namedfork/rsrc", false }, +#endif #endif };