Go to the
documentation of this file.
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #pragma once
00013
00014 #define WIN95STUFF
00015
00016
00017
00018
00019
00020
00021
00022 #if defined(_UNICODE) && defined(_MBCS)
00023 #error Cannot compile with both _UNICODE and _MBCS enabled!
00024 #endif
00025
00026
00027
00028 #ifndef _MBCS
00029 #define _MBCS // if Unicode is off, turn on multi-byte character support
00030 #endif
00031
00032
00033 #ifdef _UNICODE
00034
00035 #ifdef _MBCS
00036 #undef _MBCS // can't have both Unicode and MBCS at once -- Unicode wins
00037 #endif
00038
00039 #undef UNICODE
00040 #define UNICODE
00041
00042 #undef STRCONST
00043 #define STRCONST L
00044
00045 #endif
00046
00047
00048 #include <tchar.h>
00049
00050
00051
00052 typedef __wchar_t mwchar_t;
00053
00054
00055
00056
00057
00058
00059
00060 #ifdef _UNICODE
00061
00062
00063 #ifdef _UNICODE_MODULE_FOR_MBCS_MAX
00064 #define MCHAR char
00065 #define LPCMSTR const MCHAR*
00066 #define LPMSTR MCHAR*
00067 #define _M_TEXT(x) x
00068 #define M_STD_STRING std::string
00069 #define M_LOADSTRING ::LoadStringA
00070 #define M_STD_OSTRINGSTREAM std::ostringstream
00071 #define M_STD_ISTRINGSTREAM std::istringstream
00072 #define M_STD_CERR std::cerr
00073 #define M_STD_OSTREAM std::ostream
00074 #define M_STD_ISTREAM std::istream
00075 #define M_STD_COUT std::cout
00076 #else
00077 #define MCHAR mwchar_t
00078 #define LPCMSTR const MCHAR*
00079 #define LPMSTR MCHAR*
00080 #define _M_TEXT(x) L ## x
00081 #define M_STD_STRING std::wstring
00082 #define M_LOADSTRING ::LoadStringW
00083 #define M_STD_OSTRINGSTREAM std::wostringstream
00084 #define M_STD_ISTRINGSTREAM std::wistringstream
00085 #define M_STD_CERR std::wcerr
00086 #define M_STD_OSTREAM std::wostream
00087 #define M_STD_ISTREAM std::wistream
00088 #define M_STD_COUT std::wcout
00089 #endif
00090 #else
00091 #define MCHAR char
00092 #define LPCMSTR const MCHAR*
00093 #define LPMSTR MCHAR*
00094 #define _M_TEXT(x) x
00095 #define M_STD_STRING std::string
00096 #define M_LOADSTRING ::LoadStringA
00097 #define M_STD_OSTRINGSTREAM std::ostringstream
00098 #define M_STD_ISTRINGSTREAM std::istringstream
00099 #define M_STD_CERR std::cerr
00100 #define M_STD_OSTREAM std::ostream
00101 #define M_STD_ISTREAM std::istream
00102 #define M_STD_COUT std::cout
00103 #endif
00104 #define _M(x) _M_TEXT(x)
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130 #ifdef _UNICODE
00131
00132
00133 #ifdef _UNICODE_MODULE_FOR_MBCS_MAX
00134 #define M2A(p) (p)
00135 #define A2M(p) (p)
00136 #define M2W(p) A2W(p)
00137 #define W2M(p) W2A(p)
00138 #define M2T(p) A2T(p)
00139 #define T2M(p) T2A(p)
00140 #else
00141 #define M2A(p) W2A(p)
00142 #define A2M(p) A2W(p)
00143 #define M2W(p) (p)
00144 #define W2M(p) (p)
00145 #define M2T(p) (p)
00146 #define T2M(p) (p)
00147 #endif
00148 #else
00149 #define M2A(p) (p)
00150 #define A2M(p) (p)
00151 #define M2W(p) A2W(p)
00152 #define W2M(p) W2A(p)
00153 #define M2T(p) A2T(p)
00154 #define T2M(p) T2A(p)
00155 #endif