]> granicus.if.org Git - taglib/commitdiff
Workaround for when MSVC doesn't have wchar_t as a built-in type
authorTsuda Kageyu <tsuda.kageyu@gmail.com>
Tue, 8 Oct 2013 10:55:44 +0000 (19:55 +0900)
committerTsuda Kageyu <tsuda.kageyu@gmail.com>
Tue, 8 Oct 2013 10:55:44 +0000 (19:55 +0900)
taglib/toolkit/unicode.h

index b9de0ea21707823b1f1de34574005133e8e87948..ebf1915d8f1c0b63b64be1f468ba5ef77714a9f0 100644 (file)
     bit mask & shift operations.
 ------------------------------------------------------------------------ */
 
+// Workaround for when MSVC doesn't have wchar_t as a built-in type.  
+#if defined(_MSC_VER) && !defined(_WCHAR_T_DEFINED)
+# include <wchar.h>
+#endif
+
 /* Some fundamental constants */
 #define UNI_REPLACEMENT_CHAR (UTF32)0x0000FFFD
 #define UNI_MAX_BMP (UTF32)0x0000FFFF
 
 namespace Unicode {
 
-typedef unsigned long  UTF32;  /* at least 32 bits */
-typedef wchar_t              UTF16;    /* TagLib assumes that wchar_t is sufficient for UTF-16. */
+typedef unsigned long  UTF32;    /* at least 32 bits */
+typedef wchar_t                UTF16;    /* TagLib assumes that wchar_t is sufficient for UTF-16. */
 typedef unsigned char  UTF8;     /* typically 8 bits */
-typedef unsigned char  Boolean; /* 0 or 1 */
+typedef unsigned char  Boolean;  /* 0 or 1 */
 
 typedef enum {
        conversionOK = 0,       /* conversion successful */