remove \r
[extl.git] / extl / config / tchar.hpp
blob56ee864a812a53168e36dc9dfb25aab3e1938177
1 /* ///////////////////////////////////////////////////////////////////////
2 * File: tchar.hpp
4 * Created: 08.04.28
5 * Updated: 08.04.28
7 * Brief: Generic International Text Function Macros
9 * [<Home>]
10 * Copyright (c) 2008-2020, Waruqi All rights reserved.
11 * //////////////////////////////////////////////////////////////////// */
13 /* //////////////////////////////////////////////////////////////////// */
14 #ifndef EXTL_CONFIG_TCHAR_H
15 #define EXTL_CONFIG_TCHAR_H
17 #ifndef EXTL_CONFIG_H
18 # error This file must be included of config.h
19 #endif
21 #ifndef EXTL_CONFIG_COMPILER_H
22 # error This file must be depended on compiler\config.h
23 #endif
25 /* ///////////////////////////////////////////////////////////////////////
26 * Unicode character-set
28 #if defined(EXTL_UNICODE) || defined(UNICODE) || defined(_UNICODE)
30 # ifndef EXTL_UNICODE
31 # define EXTL_UNICODE
32 # endif
34 # ifndef UNICODE
35 # define UNICODE
36 # endif
38 # ifndef _UNICODE
39 # define _UNICODE
40 # endif
42 #endif
44 /* ///////////////////////////////////////////////////////////////////////
45 * Includes
47 #include <stdio.h>
48 #include <ctype.h> /* for isdigit */
49 #include <wchar.h>
51 /* ///////////////////////////////////////////////////////////////////////
52 * _T() macro
54 #ifdef _T
55 # undef _T
56 #endif
58 #ifdef EXTL_UNICODE
59 # define _T(s) L ## s
60 #else
61 # define _T(s) s
62 #endif
64 /* ///////////////////////////////////////////////////////////////////////
65 * char
67 #define e_a_printf printf
68 #define e_a_fprintf fprintf
70 #define e_a_sprintf sprintf
71 #define e_a_vsnprintf _vsnprintf
73 #define e_a_fopen fopen
74 #define e_a_fsopen _fsopen
76 /* ctype-functions */
77 #define e_a_isdigit isdigit
78 #define e_a_isalpha isalpha
80 /* ///////////////////////////////////////////////////////////////////////
81 * wchar
83 #define e_w_printf wprintf
84 #define e_w_fprintf fwprintf
86 #define e_w_sprintf swprintf
87 #define e_w_vsnprintf _vsnwprintf
90 #define e_w_fopen _wfopen
91 #define e_w_fsopen _wfsopen
93 /* ctype-functions */
94 #define e_w_isdigit iswdigit
95 #define e_w_isalpha iswalpha
97 /* ///////////////////////////////////////////////////////////////////////
98 * tchar
100 #ifndef EXTL_UNICODE
102 /* format functions */
103 # define e_t_printf e_a_printf
104 # define e_t_fprintf e_a_fprintf
106 # define e_t_sprintf e_a_sprintf
107 # define e_t_vsnprintf e_a_vsnprintf
109 /* file operations */
110 # define e_t_fopen e_a_fopen
111 # define e_t_fsopen e_a_fsopen
113 /* ctype-functions */
114 # define e_t_isdigit e_a_isdigit
115 # define e_t_isalpha e_a_isalpha
117 #else
119 /* format functions */
120 # define e_t_printf e_w_printf
121 # define e_t_fprintf e_w_fprintf
123 # define e_t_sprintf e_w_sprintf
124 # define e_t_vsnprintf e_w_vsnprintf
126 /* file operations */
127 # define e_t_fopen e_w_fopen
128 # define e_t_fsopen e_w_fsopen
130 /* ctype-functions */
131 # define e_t_isdigit e_w_isdigit
132 # define e_t_isalpha e_w_isalpha
134 #endif
136 /* //////////////////////////////////////////////////////////////////// */
137 #endif /* EXTL_CONFIG_TCHAR_H */
138 /* //////////////////////////////////////////////////////////////////// */