Initial implimentation of win32_trash()
This commit is contained in:
parent
75d209e3f1
commit
61ce0798d9
3 changed files with 29 additions and 1 deletions
|
|
@ -2137,7 +2137,14 @@ static float pick_best_scape(unsigned int orig_w, unsigned int orig_h, unsigned
|
|||
#endif
|
||||
static SDL_Surface *myIMG_Load_RWops(const char *file);
|
||||
static SDL_Surface *myIMG_Load(const char *file);
|
||||
#ifndef WIN32
|
||||
static int trash(char *path);
|
||||
#else
|
||||
#ifndef UNLINK_ONLY
|
||||
static int win32_trash(char *path);
|
||||
#define trash(file) win32_trash(file)
|
||||
#endif
|
||||
#endif
|
||||
int file_exists(char *path);
|
||||
|
||||
int generate_fontconfig_cache_spinner(SDL_Surface * screen);
|
||||
|
|
@ -25851,6 +25858,7 @@ int main(int argc, char *argv[])
|
|||
/**
|
||||
* FIXME
|
||||
*/
|
||||
#ifndef WIN32
|
||||
static int trash(char *path)
|
||||
{
|
||||
#ifdef UNLINK_ONLY
|
||||
|
|
@ -26023,6 +26031,7 @@ static int trash(char *path)
|
|||
return (0);
|
||||
#endif /* UNLINK_ONLY */
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* FIXME
|
||||
|
|
|
|||
13
src/win32_trash.c
Normal file
13
src/win32_trash.c
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
#include <windows.h>
|
||||
|
||||
int win32_trash(char *path);
|
||||
int win32_trash(char *path)
|
||||
{
|
||||
SHFILEOPSTRUCT op;
|
||||
|
||||
op.wFunc = FO_DELETE;
|
||||
op.pFrom = path;
|
||||
op.fFlags = FOF_SILENT|FOF_ALLOWUNDO;
|
||||
|
||||
return SHFileOperationA(&op);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue