TYPES_CE.H
[目次 | 型・クラス・構造体 | マクロ]
1|/**************************************************************************
2|* 1. <<< 基本型 (types) for WindowsCE PB >>>
3|***************************************************************************/
4|
5|#ifndef __TYPES_H
6|#define __TYPES_H
7|
8|
9|/**************************************************************************
10|* 2. <<< 基本型の省略形 >>>
11|* 3. <<< [u_char, u_short, u_int, u_long] >>>
12|***************************************************************************/
13|#ifndef TYPES_NOT_DEFINE_U_INT
14|
15|typedef unsigned char u_char;
16|typedef unsigned short u_short;
17|typedef unsigned int u_int;
18|typedef unsigned long u_long;
19|
20|#endif
21|
22|
23|/**************************************************************************
24|* 4. <<< NULL ポインタ >>>
25|* 5. <<< [NULL] >>>
26|***************************************************************************/
27|#ifndef NULL
28| #ifdef __cplusplus
29| #define NULL 0
30| #else
31| #define NULL ((void*)0)
32| #endif
33|#endif
34|
35|
36|/**************************************************************************
37|* 6. <<< [STATIC] >>>
38|***************************************************************************/
39|#ifndef TYPES_NOT_DEFINE_STATIC
40|
41|#ifdef NDEBUG
42| #define STATIC static
43|#else
44| #define STATIC
45|#endif
46|
47|#endif
48|
49|
50|/**************************************************************************
51|* 7. <<< 論理型 >>>
52|* 8. <<< [bool, true, false] >>>
53|*【補足】
54|*・論理型は、ANSI C++ の基本型です。
55|***************************************************************************/
56|#ifndef TYPES_NOT_DEFINE_BOOL
57|
58|/* bool 型がコンパイラで定義されているかどうか判定する */
59|#ifndef __cplusplus
60| #define TYPES_BOOL_CPP_NEED
61|#else
62| #if _MSC_VER < 1100
63| #define TYPES_BOOL_CPP_NEED
64| #endif
65|#endif
66|
67|
68|/* bool 型を定義する */
69|#ifdef TYPES_BOOL_CPP_NEED
70|
71|typedef char bool;
72|#define true 1
73|#define false 0
74|
75|#endif /* TYPES_BOOL_CPP_NEED */
76|
77|
78|#ifndef __cplusplus
79|#undef TYPES_BOOL_CPP_NEED
80|#endif
81|
82|
83|
84|/**************************************************************************
85|* 9. <<< [Bool_chk] 論理型の正規チェック >>>
86|***************************************************************************/
87|#define Bool_chk(var) ( (var)==true || (var)==false )
88|
89|
90|#endif /* TYPES_NOT_DEFINE_BOOL */
91|
92|
93|#endif /* __TYPES_H */
94|
95|
96|
97|
98|