enhanced types and macros to handle the wchar_t type defined to 1 byte in size

This commit is contained in:
2014-11-17 15:25:55 +00:00
parent e3be2e5273
commit e57c9673d1
4 changed files with 18 additions and 6 deletions

View File

@ -251,7 +251,11 @@
* The #QSE_WT macro maps a multi-byte literal string to a wide character
* string by prefixing it with @b L.
*/
#define QSE_WT(txt) (L ## txt)
#if (QSE_SIZEOF_WCHAR_T == QSE_SIZEOF_MCHAR_T)
# define QSE_WT(txt) (txt)
#else
# define QSE_WT(txt) (L ## txt)
#endif
/** @def QSE_T
* The #QSE_T macro maps to #QSE_MT if #QSE_CHAR_IS_MCHAR is defined, and to

View File

@ -528,6 +528,12 @@ typedef int qse_mcint_t;
#elif defined(__GNUC__) && defined(__WCHAR_TYPE__) && defined(__WINT_TYPE__)
typedef __WCHAR_TYPE__ qse_wchar_t;
typedef __WINT_TYPE__ qse_wcint_t;
#elif (QSE_SIZEOF_WCHAR_T == QSE_SIZEOF_MCHAR_T)
/* most likely, there is no support for wchar_t */
typedef qse_mchar_t qse_wchar_t;
typedef qse_mcint_t qse_wcint_t;
#elif (QSE_SIZEOF_WCHAR_T == 2) || (QSE_SIZEOF_WCHAR_T == 0)
typedef unsigned short qse_wchar_t;
typedef unsigned short qse_wcint_t;