30#ifndef _RWSTD_RW_META_SIGN_H_INCLUDED
31#define _RWSTD_RW_META_SIGN_H_INCLUDED
43template <
class _TypeT>
44struct __rw_sign_helper
51struct __rw_sign_helper<char>
53#if (_RWSTD_CHAR_MIN < 0)
55 typedef unsigned char _C_Uint;
57 typedef signed char _C_Sint;
62#ifndef _RWSTD_NO_NATIVE_WCHAR_T
67#if (_RWSTD_WCHAR_MIN < 0)
68 typedef wchar_t _C_Sint;
70# if (_RWSTD_WCHAR_SIZE == _RWSTD_CHAR_SIZE)
71 typedef unsigned char _C_Uint;
72# elif (_RWSTD_WCHAR_SIZE == _RWSTD_SHRT_SIZE)
73 typedef unsigned short _C_Uint;
74# elif (_RWSTD_WCHAR_SIZE == _RWSTD_INT_SIZE)
75 typedef unsigned int _C_Uint;
76# elif (_RWSTD_WCHAR_SIZE == _RWSTD_LONG_SIZE)
77 typedef unsigned long _C_Uint;
78# elif (_RWSTD_WCHAR_SIZE == _RWSTD_LLONG_SIZE)
79 typedef unsigned long long _C_Uint;
84# if (_RWSTD_WCHAR_SIZE == _RWSTD_CHAR_SIZE)
85 typedef signed char _C_Sint;
86# elif (_RWSTD_WCHAR_SIZE == _RWSTD_SHRT_SIZE)
87 typedef signed short _C_Sint;
88# elif (_RWSTD_WCHAR_SIZE == _RWSTD_INT_SIZE)
89 typedef signed int _C_Sint;
90# elif (_RWSTD_WCHAR_SIZE == _RWSTD_LONG_SIZE)
91 typedef signed long _C_Sint;
92# elif (_RWSTD_WCHAR_SIZE == _RWSTD_LLONG_SIZE)
93 typedef signed long long _C_Sint;
96 typedef wchar_t _C_Uint;
103struct __rw_sign_helper<signed char>
105 typedef signed char _C_Sint;
106 typedef unsigned char _C_Uint;
110struct __rw_sign_helper<unsigned char>
112 typedef signed char _C_Sint;
113 typedef unsigned char _C_Uint;
117struct __rw_sign_helper<signed short>
119 typedef signed short _C_Sint;
120 typedef unsigned short _C_Uint;
124struct __rw_sign_helper<unsigned short>
126 typedef signed short _C_Sint;
127 typedef unsigned short _C_Uint;
131struct __rw_sign_helper<signed int>
133 typedef signed int _C_Sint;
134 typedef unsigned int _C_Uint;
138struct __rw_sign_helper<unsigned int>
140 typedef signed int _C_Sint;
141 typedef unsigned int _C_Uint;
145struct __rw_sign_helper<signed long>
147 typedef signed long _C_Sint;
148 typedef unsigned long _C_Uint;
152struct __rw_sign_helper<unsigned long>
154 typedef signed long _C_Sint;
155 typedef unsigned long _C_Uint;
159#ifndef _RWSTD_NO_LONG_LONG
162struct __rw_sign_helper<signed long long>
164 typedef signed long long _C_Sint;
165 typedef unsigned long long _C_Uint;
169struct __rw_sign_helper<unsigned long long>
171 typedef signed long long _C_Sint;
172 typedef unsigned long long _C_Uint;
180template <_RWSTD_SIZE_T _Size>
181struct __rw_enum_helper
183 typedef void _C_Sint;
184 typedef void _C_Uint;
188struct __rw_enum_helper<_RWSTD_CHAR_SIZE>
190 typedef signed char _C_Sint;
191 typedef unsigned char _C_Uint;
195struct __rw_enum_helper<_RWSTD_SHRT_SIZE>
197 typedef signed short _C_Sint;
198 typedef unsigned short _C_Uint;
202struct __rw_enum_helper<_RWSTD_INT_SIZE>
204 typedef signed int _C_Sint;
205 typedef unsigned int _C_Uint;
208#if (_RWSTD_INT_SIZE != _RWSTD_LONG_SIZE)
211struct __rw_enum_helper<_RWSTD_LONG_SIZE>
213 typedef signed long _C_Sint;
214 typedef unsigned long _C_Uint;
219#ifndef _RWSTD_NO_LONG_LONG
220# if (_RWSTD_LONG_SIZE != _RWSTD_LLONG_SIZE)
223struct __rw_enum_helper<_RWSTD_LLONG_SIZE>
225 typedef signed long long _C_Sint;
226 typedef unsigned long long _C_Uint;
232template <
class _TypeT>
233struct __rw_make_signed
239 typedef typename __rw_remove_cv<_TypeT>::type _NoCV_TypeT;
244 __rw_conditional<__rw_is_integral<_NoCV_TypeT>::value,
245 typename __rw_sign_helper<_NoCV_TypeT>::_C_Sint,
246 typename __rw_enum_helper<
sizeof (_TypeT) >::_C_Sint
250 __rw_conditional<__rw_is_const<_TypeT>::value,
251 typename __rw_add_const<_NoCV_TypeU>::type,
252 _NoCV_TypeU>::type _NoV_TypeU;
255 __rw_conditional<__rw_is_volatile<_TypeT>::value,
256 typename __rw_add_volatile<_NoV_TypeU>::type,
257 _NoV_TypeU>::type _TypeU;
263#define _RWSTD_MAKE_SIGNED(T) _RW::__rw_make_signed<T>::type
265template <
class _TypeT>
266struct __rw_make_unsigned
272 typedef typename __rw_remove_cv<_TypeT>::type _NoCV_TypeT;
277 __rw_conditional<__rw_is_integral<_NoCV_TypeT>::value,
278 typename __rw_sign_helper<_NoCV_TypeT>::_C_Uint,
279 typename __rw_enum_helper<
sizeof (_TypeT) >::_C_Uint
283 __rw_conditional<__rw_is_const<_TypeT>::value,
284 typename __rw_add_const<_NoCV_TypeU>::type,
285 _NoCV_TypeU>::type _NoV_TypeU;
288 __rw_conditional<__rw_is_volatile<_TypeT>::value,
289 typename __rw_add_volatile<_NoV_TypeU>::type,
290 _NoV_TypeU>::type _TypeU;
296#define _RWSTD_MAKE_UNSIGNED(T) _RW::__rw_make_unsigned<T>::type
#define _RWSTD_NAMESPACE(name)