Fix RGBFIX --output with a pre-existing or same-as-input file (#2145)

This commit is contained in:
Rangi authored and GitHub committed 2026-09-27 01:31:53 +02:00
1 parent f5f503c7b1
commit 321ad497fa
3 files changed
+48 -4

No files matched your search

+6
View File
@@ -53,6 +53,12 @@
#define O_TEXT 0 // Assume that it's not defined either
#endif // _MSC_VER
// MSVC doesn't have POSIX `ftruncate`, use a suitable replacement
#if defined(_MSC_VER)
#include <io.h> // IWYU pragma: export
#define ftruncate _chsize_s
#endif
// Windows has stdin and stdout open as text by default, which we may not want
#if defined(_MSC_VER) || defined(__MINGW32__)
#include <io.h> // IWYU pragma: export