From 87ed5bc9911f5c01eb76cf17b69f77aff5383c8e Mon Sep 17 00:00:00 2001 From: dolphin6k Date: Fri, 29 Oct 2021 23:37:19 +0900 Subject: [PATCH] tweak for win32_trash() --- src/tuxpaint.c | 4 +++- src/win32_trash.c | 10 +++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/tuxpaint.c b/src/tuxpaint.c index eb841d00d..05b537833 100644 --- a/src/tuxpaint.c +++ b/src/tuxpaint.c @@ -2141,8 +2141,10 @@ static SDL_Surface *myIMG_Load(const char *file); static int trash(char *path); #else #ifndef UNLINK_ONLY -static int win32_trash(char *path); +extern int win32_trash(char *path); #define trash(file) win32_trash(file) +#else +static int trash(char *path); #endif #endif int file_exists(char *path); diff --git a/src/win32_trash.c b/src/win32_trash.c index d7fd90f41..dd032a554 100644 --- a/src/win32_trash.c +++ b/src/win32_trash.c @@ -1,13 +1,17 @@ #include +#include +#include int win32_trash(char *path); int win32_trash(char *path) { SHFILEOPSTRUCT op; - + int ret; + op.wFunc = FO_DELETE; op.pFrom = path; op.fFlags = FOF_SILENT|FOF_ALLOWUNDO; - - return SHFileOperationA(&op); + ret = SHFileOperationA(&op); + + return ret; }