tweak for win32_trash()

This commit is contained in:
dolphin6k 2021-10-29 23:37:19 +09:00
parent adc181e3ec
commit 87ed5bc991
2 changed files with 10 additions and 4 deletions

View file

@ -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);

View file

@ -1,13 +1,17 @@
#include <windows.h>
#include <string.h>
#include <stdlib.h>
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;
}