diff options
author | Robin Gareus <robin@gareus.org> | 2020-03-13 01:19:47 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2020-03-13 01:21:51 +0100 |
commit | 26b6b8d84000c7cc0a2af64b7084557a8b0395af (patch) | |
tree | b6032837ab8604b083f9b3a8cca9eddf5827940a /libs/pbd | |
parent | 64ddc5dd3279cd8f06d020f0742cc38096ff1830 (diff) |
mingw/gcc-8: use glib's stat(), drop hardlink support
Diffstat (limited to 'libs/pbd')
-rw-r--r-- | libs/pbd/file_utils.cc | 6 | ||||
-rw-r--r-- | libs/pbd/pbd/gstdio_compat.h | 4 |
2 files changed, 7 insertions, 3 deletions
diff --git a/libs/pbd/file_utils.cc b/libs/pbd/file_utils.cc index 120327e5c9..020e02cc71 100644 --- a/libs/pbd/file_utils.cc +++ b/libs/pbd/file_utils.cc @@ -360,8 +360,10 @@ bool hard_link (const std::string& existing_file, const std::string& new_path) { #ifdef PLATFORM_WINDOWS -# if defined (COMPILER_MINGW) && !defined(_WIN64) && defined(__GNUC__) && __GNUC__ >= 8 - return false; // 32bit windows, mingw +# if defined (COMPILER_MINGW) && defined(__GNUC__) && __GNUC__ == 8 + /* For some reason mingx 8.3.0 does not support CreateHardLinkA() + * (mingw/gcc-4.9 does) */ + return false; # else /* see also ntfs_link -- msvc only pbd extension */ return CreateHardLinkA (new_path.c_str(), existing_file.c_str(), NULL); diff --git a/libs/pbd/pbd/gstdio_compat.h b/libs/pbd/pbd/gstdio_compat.h index 0130f36cde..5d8765d14e 100644 --- a/libs/pbd/pbd/gstdio_compat.h +++ b/libs/pbd/pbd/gstdio_compat.h @@ -49,8 +49,10 @@ pbd_g_stat(const gchar *filename, GStatBufW32 *buf) * while the windows API is * int _wstat(const wchar_t*, struct _stat*) * note that struct _stat != struct stat; + * + * This has been fixed with sometime between 2.42.0 and 2.64.1 */ -#if defined(_WIN32) && !defined(_MSC_VER) && defined(_WIN64) +#if defined(_WIN32) && !defined(_MSC_VER) && defined(_WIN64) && !GLIB_CHECK_VERSION (2,64,1) #include <windows.h> #include <errno.h> #include <wchar.h> |