mirror of
https://github.com/transmission/transmission.git
synced 2025-12-24 12:28:52 +00:00
There're places where manual intervention is still required as uncrustify is not ideal (unfortunately), but at least one may rely on it to do the right thing most of the time (e.g. when sending in a patch). The style itself is quite different from what we had before but making it uniform across all the codebase is the key. I also hope that it'll make the code more readable (YMMV) and less sensitive to further changes.
37 lines
811 B
C
37 lines
811 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.
|
|
*
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#ifdef _WIN32
|
|
|
|
#include <windows.h>
|
|
|
|
/* MinGW :( */
|
|
#ifndef ERROR_DIRECTORY_NOT_SUPPORTED
|
|
#define ERROR_DIRECTORY_NOT_SUPPORTED 336
|
|
#endif
|
|
|
|
#define TR_ERROR_IS_ENOENT(code) ((code) == ERROR_FILE_NOT_FOUND || (code) == ERROR_PATH_NOT_FOUND)
|
|
#define TR_ERROR_IS_ENOSPC(code) ((code) == ERROR_DISK_FULL)
|
|
|
|
#define TR_ERROR_EINVAL ERROR_INVALID_PARAMETER
|
|
#define TR_ERROR_EISDIR ERROR_DIRECTORY_NOT_SUPPORTED
|
|
|
|
#else /* _WIN32 */
|
|
|
|
#include <errno.h>
|
|
|
|
#define TR_ERROR_IS_ENOENT(code) ((code) == ENOENT)
|
|
#define TR_ERROR_IS_ENOSPC(code) ((code) == ENOSPC)
|
|
|
|
#define TR_ERROR_EINVAL EINVAL
|
|
#define TR_ERROR_EISDIR EISDIR
|
|
|
|
#endif /* _WIN32 */
|