Files
transmission/libtransmission/error-types.h
Mike Gelfand 4fe156a255 Fix tr_moveFile error reporting
Remove unused `renamed` argument.
Use tr_error instead of errno to report errors to support Win32 file
wrappers which do not map Windows error codes to POSIX ones.
Return bool instead of int (0/-1).

Uncomment tr_error_prefix and tr_error_propagate_prefixed functions.
2014-12-10 18:37:58 +00:00

32 lines
547 B
C

/*
* 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.
*
* $Id$
*/
#ifndef TR_ERROR_TYPES_H
#define TR_ERROR_TYPES_H
#ifdef _WIN32
#include <windows.h>
#define TR_ERROR_IS_ENOSPC(code) ((code) == ERROR_DISK_FULL)
#define TR_ERROR_EINVAL ERROR_INVALID_PARAMETER
#else /* _WIN32 */
#include <errno.h>
#define TR_ERROR_IS_ENOSPC(code) ((code) == ENOSPC)
#define TR_ERROR_EINVAL EINVAL
#endif /* _WIN32 */
#endif /* TR_ERROR_TYPES_H */