source: trunk/libtransmission/error-types.h

Last change on this file was 14724, checked in by jordan, 5 years ago

use '#pragma once' instead of #ifndef..#define..#endif guards

  • Property svn:keywords set to Date Rev Author Id
File size: 857 bytes
Line 
1/*
2 * This file Copyright (C) 2014 Mnemosyne LLC
3 *
4 * It may be used under the GNU GPL versions 2 or 3
5 * or any future license endorsed by Mnemosyne LLC.
6 *
7 * $Id: error-types.h 14724 2016-03-29 16:37:21Z mikedld $
8 */
9
10#pragma once
11
12#ifdef _WIN32
13
14#include <windows.h>
15
16/* MinGW :( */
17#ifndef ERROR_DIRECTORY_NOT_SUPPORTED
18 #define ERROR_DIRECTORY_NOT_SUPPORTED 336
19#endif
20
21#define TR_ERROR_IS_ENOENT(code) ((code) == ERROR_FILE_NOT_FOUND || \
22                                  (code) == ERROR_PATH_NOT_FOUND)
23#define TR_ERROR_IS_ENOSPC(code) ((code) == ERROR_DISK_FULL)
24
25#define TR_ERROR_EINVAL ERROR_INVALID_PARAMETER
26#define TR_ERROR_EISDIR ERROR_DIRECTORY_NOT_SUPPORTED
27
28#else /* _WIN32 */
29
30#include <errno.h>
31
32#define TR_ERROR_IS_ENOENT(code) ((code) == ENOENT)
33#define TR_ERROR_IS_ENOSPC(code) ((code) == ENOSPC)
34
35#define TR_ERROR_EINVAL EINVAL
36#define TR_ERROR_EISDIR EISDIR
37
38#endif /* _WIN32 */
39
Note: See TracBrowser for help on using the repository browser.