2014-12-10 18:23:11 +00:00
|
|
|
/*
|
|
|
|
* This file Copyright (C) 2014 Mnemosyne LLC
|
|
|
|
*
|
|
|
|
* It may be used under the GNU GPL versions 2 or 3
|
|
|
|
* or any future license endorsed by Mnemosyne LLC.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2016-03-29 16:37:21 +00:00
|
|
|
#pragma once
|
2014-12-10 18:23:11 +00:00
|
|
|
|
|
|
|
#ifdef _WIN32
|
|
|
|
|
|
|
|
#include <windows.h>
|
|
|
|
|
2015-04-11 10:58:08 +00:00
|
|
|
/* MinGW :( */
|
|
|
|
#ifndef ERROR_DIRECTORY_NOT_SUPPORTED
|
2017-04-19 12:04:45 +00:00
|
|
|
#define ERROR_DIRECTORY_NOT_SUPPORTED 336
|
2015-04-11 10:58:08 +00:00
|
|
|
#endif
|
|
|
|
|
2017-04-19 12:04:45 +00:00
|
|
|
#define TR_ERROR_IS_ENOENT(code) ((code) == ERROR_FILE_NOT_FOUND || (code) == ERROR_PATH_NOT_FOUND)
|
2014-12-10 18:23:11 +00:00
|
|
|
#define TR_ERROR_IS_ENOSPC(code) ((code) == ERROR_DISK_FULL)
|
|
|
|
|
2014-12-10 18:37:58 +00:00
|
|
|
#define TR_ERROR_EINVAL ERROR_INVALID_PARAMETER
|
2015-04-11 10:51:59 +00:00
|
|
|
#define TR_ERROR_EISDIR ERROR_DIRECTORY_NOT_SUPPORTED
|
2014-12-10 18:37:58 +00:00
|
|
|
|
2014-12-10 18:23:11 +00:00
|
|
|
#else /* _WIN32 */
|
|
|
|
|
|
|
|
#include <errno.h>
|
|
|
|
|
2015-04-11 10:51:59 +00:00
|
|
|
#define TR_ERROR_IS_ENOENT(code) ((code) == ENOENT)
|
2014-12-10 18:23:11 +00:00
|
|
|
#define TR_ERROR_IS_ENOSPC(code) ((code) == ENOSPC)
|
|
|
|
|
2014-12-10 18:37:58 +00:00
|
|
|
#define TR_ERROR_EINVAL EINVAL
|
2015-04-11 10:51:59 +00:00
|
|
|
#define TR_ERROR_EISDIR EISDIR
|
2014-12-10 18:37:58 +00:00
|
|
|
|
2014-12-10 18:23:11 +00:00
|
|
|
#endif /* _WIN32 */
|