From f14f9516e2bc347db6aed3b1c118088594cb9753 Mon Sep 17 00:00:00 2001 From: Bruno Lopes Date: Tue, 31 Mar 2026 20:13:02 -0300 Subject: [PATCH] plug-ins: Fix some problematic Windows functions The macro should be enough but on these source files it does not work. --- plug-ins/common/file-compressor.c | 5 ++++- plug-ins/script-fu/libscriptfu/ftx/ftx.c | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/plug-ins/common/file-compressor.c b/plug-ins/common/file-compressor.c index 2a4c26a7b0..42ac83ea62 100644 --- a/plug-ins/common/file-compressor.c +++ b/plug-ins/common/file-compressor.c @@ -81,7 +81,6 @@ #ifdef _WIN32 #include #define close _close -#define fileno _fileno #endif #include @@ -1097,7 +1096,11 @@ zip_load (GFile *infile, if (archive_read_next_header (a, &entry) == ARCHIVE_OK) { +#ifndef _WIN32 r = archive_read_data_into_fd (a, fileno (out)); +#else + r = archive_read_data_into_fd (a, _fileno (out)); +#endif if (r != ARCHIVE_OK) { diff --git a/plug-ins/script-fu/libscriptfu/ftx/ftx.c b/plug-ins/script-fu/libscriptfu/ftx/ftx.c index cf77c19e11..b57c297a3f 100644 --- a/plug-ins/script-fu/libscriptfu/ftx/ftx.c +++ b/plug-ins/script-fu/libscriptfu/ftx/ftx.c @@ -15,7 +15,6 @@ #endif #ifdef _WIN32 #include -#define unlink _unlink #endif #include @@ -152,7 +151,11 @@ pointer foreign_filedelete(scheme *sc, pointer args) filename = sc->vptr->string_value(first_arg); filename = g_filename_from_utf8 (filename, -1, NULL, NULL, NULL); +#ifndef _WIN32 retcode = unlink(filename); +#else + retcode = _unlink(filename); +#endif if (retcode == 0) ret = sc->T; else