- Supports more Apple platforms, including future ones, which will always support std::filesystem, like with visionOS
- Simplifies cases. Undefined preprocessor values are guaranteed to default evaluate to 0
- Moves <Availability.h> include inside conditional, avoiding the include where not needed.
- Removes reference to wchar for std headers on windows, which seemed to be out of date, since the define it might have been referring to was commented
- (And some other small things.)
This alias is needed whether or not the install rules of `ghcfilesystem`
are enabled. It allows projects to use the same target regardless of
where `ghcfilesystem` comes from, `add_subdirectory` or `find_package`.
There is no path length limitation there, even via pathconf. But glibc
provides a getcwd function that allocates the buffer dynamically so we can
just leverage that.
The previous implementation tried to detect old deployment targets for macOS that doesn't have the newer `utimensat` call. Unfortunately, it would just detect macOS, and didn't check for the corresponding iOS/tvOS/watchOS version numbers. On those platforms, last_write_time() was effectively a no-op, failing silently and not modifying the mtime of the file.
This patch adds detection for these platforms. It also removes the special casing when newer versions of macOS/iOS/tvOS/watchOS are used as the deployment targets, and instead folds it into the default POSIX branch.
CMakeLists.txt:
Write a ghc_filesystem-config-version.cmake file and install it, so that
other projects may rely on the exact version of ghc_filesystem.
The compatibility mode implies, that any version of ghc_filesystem with
the same major version is feature compatible.
CMakeLists.txt:
Declare the project's version in the cmake project() call so that it may
be exported to the project's cmake integration (used by other projects).
The old code truncated time_t to a 32-bit value
when using Int32x32To64. This example code has been fixed
on MSDN a while ago, so this change only updates it to
the current version.
More on this issue:
https://cookieplmonster.github.io/2022/02/17/year-2038-problem/