-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdef.h
41 lines (35 loc) · 1.04 KB
/
def.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/**
* @file def.h
*
* Copyright(c) 2015 大前良介(OHMAE Ryosuke)
*
* This software is released under the MIT License.
* http://opensource.org/licenses/MIT
*
* @brief プロジェクトに依存せず使える定義
* @author <a href="mailto:[email protected]">大前良介(OHMAE Ryosuke)</a>
* @date 2015/02/28
*/
#ifndef DEF_H_
#define DEF_H_
#ifdef _DEBUG_
#define ERR(fmt, ...) fprintf(stderr, "\033[31m[%-15.15s:%4u] " fmt "\033[0m\n", __FILE__, __LINE__, ##__VA_ARGS__)
#define DBG(fmt, ...) fprintf(stderr, "\033[33m[%-15.15s:%4u] " fmt "\033[0m\n", __FILE__, __LINE__, ##__VA_ARGS__)
#define LOG(fmt, ...) fprintf(stderr, "[%-15.15s:%4u] " fmt "\n", __FILE__, __LINE__, ##__VA_ARGS__)
#define PRT(fmt, ...) fprintf(stderror, fmt, ##__VA_ARGS__)
#else
#define ERR(fmt, ...)
#define DBG(fmt, ...)
#define LOG(fmt, ...)
#define PRT(fmt, ...)
#endif
#define TRUE 1
#define FALSE 0
/**
* @brief 成功失敗を表現する
*/
typedef enum result_t {
SUCCESS = 0, /**< 成功 */
FAILURE = -1, /**< 失敗 */
} result_t;
#endif /* DEF_H_ */