removed wxWCHAR_T_IS_SEPARATE_TYPE: there already was wxWCHAR_T_IS_REAL_TYPE with the exact same meaning and definition

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@47230 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík
2007-07-08 07:04:38 +00:00
parent 0728199b91
commit c5cf866314
6 changed files with 24 additions and 34 deletions

4
configure vendored
View File

@@ -34140,12 +34140,12 @@ echo "${ECHO_T}$wx_cv_wchar_t_is_separate_type" >&6; }
if test "$wx_cv_wchar_t_is_separate_type" = "yes"; then if test "$wx_cv_wchar_t_is_separate_type" = "yes"; then
cat >>confdefs.h <<\_ACEOF cat >>confdefs.h <<\_ACEOF
#define wxWCHAR_T_IS_SEPARATE_TYPE 1 #define wxWCHAR_T_IS_REAL_TYPE 1
_ACEOF _ACEOF
else else
cat >>confdefs.h <<\_ACEOF cat >>confdefs.h <<\_ACEOF
#define wxWCHAR_T_IS_SEPARATE_TYPE 0 #define wxWCHAR_T_IS_REAL_TYPE 0
_ACEOF _ACEOF
fi fi

View File

@@ -4430,9 +4430,9 @@ AC_CACHE_CHECK([if wchar_t is separate type],
) )
if test "$wx_cv_wchar_t_is_separate_type" = "yes"; then if test "$wx_cv_wchar_t_is_separate_type" = "yes"; then
AC_DEFINE(wxWCHAR_T_IS_SEPARATE_TYPE, 1) AC_DEFINE(wxWCHAR_T_IS_REAL_TYPE, 1)
else else
AC_DEFINE(wxWCHAR_T_IS_SEPARATE_TYPE, 0) AC_DEFINE(wxWCHAR_T_IS_REAL_TYPE, 0)
fi fi
AC_LANG_POP() dnl C++ AC_LANG_POP() dnl C++

View File

@@ -1139,18 +1139,26 @@ typedef float wxFloat32;
of treating it as a real fundamental type, set wxWCHAR_T_IS_REAL_TYPE to 0 of treating it as a real fundamental type, set wxWCHAR_T_IS_REAL_TYPE to 0
for them and to 1 for all the others. for them and to 1 for all the others.
*/ */
#if wxUSE_WCHAR_T #ifndef wxWCHAR_T_IS_REAL_TYPE
/* /*
VC++ typedefs wchar_t as unsigned short by default, that is unless VC++ typedefs wchar_t as unsigned short by default until VC8, that is
/Za or /Zc:wchar_t option is used in which case _WCHAR_T_DEFINED is unless /Za or /Zc:wchar_t option is used in which case _WCHAR_T_DEFINED
defined. is defined.
*/ */
# if defined(__VISUALC__) && !defined(_NATIVE_WCHAR_T_DEFINED) # if defined(__VISUALC__) && !defined(_NATIVE_WCHAR_T_DEFINED)
# define wxWCHAR_T_IS_REAL_TYPE 0 # define wxWCHAR_T_IS_REAL_TYPE 0
# else /* compiler having standard-conforming wchar_t */ # else /* compiler having standard-conforming wchar_t */
# define wxWCHAR_T_IS_REAL_TYPE 1 # define wxWCHAR_T_IS_REAL_TYPE 1
# endif # endif
#endif /* wxUSE_WCHAR_T */ #endif /* !defined(wxWCHAR_T_IS_REAL_TYPE) */
/* Helper macro for doing something dependent on whether wchar_t is or isn't a
typedef inside another macro. */
#if wxWCHAR_T_IS_REAL_TYPE
#define wxIF_WCHAR_T_TYPE(x) x
#else /* !wxWCHAR_T_IS_REAL_TYPE */
#define wxIF_WCHAR_T_TYPE(x)
#endif /* wxWCHAR_T_IS_REAL_TYPE/!wxWCHAR_T_IS_REAL_TYPE */
/* /*
This constant should be used instead of NULL in vararg functions taking This constant should be used instead of NULL in vararg functions taking

View File

@@ -15,24 +15,6 @@
#include "wx/chartype.h" #include "wx/chartype.h"
#include "wx/stringimpl.h" #include "wx/stringimpl.h"
#ifndef wxWCHAR_T_IS_SEPARATE_TYPE
// older versions of VC++ have wchar_t as typedef by default; this is
// configurable, so we have to check which behaviour is enabled
#if defined(__VISUALC__) && !defined(_NATIVE_WCHAR_T_DEFINED)
#define wxWCHAR_T_IS_SEPARATE_TYPE 0
#else
#define wxWCHAR_T_IS_SEPARATE_TYPE 1
#endif
#endif
// helper macro for doing something dependent on whether wchar_t is or isn't a
// typedef inside another macro
#if wxWCHAR_T_IS_SEPARATE_TYPE
#define wxIF_WCHAR_T_TYPE(x) x
#else // !wxWCHAR_T_IS_SEPARATE_TYPE
#define wxIF_WCHAR_T_TYPE(x)
#endif // wxWCHAR_T_IS_SEPARATE_TYPE/!wxWCHAR_T_IS_SEPARATE_TYPE
class WXDLLIMPEXP_BASE wxUniCharRef; class WXDLLIMPEXP_BASE wxUniCharRef;
class WXDLLIMPEXP_BASE wxStringIteratorNode; class WXDLLIMPEXP_BASE wxStringIteratorNode;
@@ -54,7 +36,7 @@ public:
wxUniChar(unsigned char c) { m_value = From8bit((char)c); } wxUniChar(unsigned char c) { m_value = From8bit((char)c); }
// Create the character from a wchar_t character value. // Create the character from a wchar_t character value.
#if wxWCHAR_T_IS_SEPARATE_TYPE #if wxWCHAR_T_IS_REAL_TYPE
wxUniChar(wchar_t c) { m_value = c; } wxUniChar(wchar_t c) { m_value = c; }
#endif #endif
@@ -91,7 +73,7 @@ public:
// functions // functions
operator char() const { return To8bit(m_value); } operator char() const { return To8bit(m_value); }
operator unsigned char() const { return (unsigned char)To8bit(m_value); } operator unsigned char() const { return (unsigned char)To8bit(m_value); }
#if wxWCHAR_T_IS_SEPARATE_TYPE #if wxWCHAR_T_IS_REAL_TYPE
operator wchar_t() const { return (wchar_t)m_value; } operator wchar_t() const { return (wchar_t)m_value; }
#endif #endif
operator int() const { return (int)m_value; } operator int() const { return (int)m_value; }
@@ -118,7 +100,7 @@ public:
wxUniChar& operator=(const wxUniCharRef& c); wxUniChar& operator=(const wxUniCharRef& c);
wxUniChar& operator=(char c) { m_value = From8bit(c); return *this; } wxUniChar& operator=(char c) { m_value = From8bit(c); return *this; }
wxUniChar& operator=(unsigned char c) { m_value = From8bit((char)c); return *this; } wxUniChar& operator=(unsigned char c) { m_value = From8bit((char)c); return *this; }
#if wxWCHAR_T_IS_SEPARATE_TYPE #if wxWCHAR_T_IS_REAL_TYPE
wxUniChar& operator=(wchar_t c) { m_value = c; return *this; } wxUniChar& operator=(wchar_t c) { m_value = c; return *this; }
#endif #endif
wxUniChar& operator=(int c) { m_value = c; return *this; } wxUniChar& operator=(int c) { m_value = c; return *this; }
@@ -213,7 +195,7 @@ public:
wxUniCharRef& operator=(char c) { return *this = wxUniChar(c); } wxUniCharRef& operator=(char c) { return *this = wxUniChar(c); }
wxUniCharRef& operator=(unsigned char c) { return *this = wxUniChar(c); } wxUniCharRef& operator=(unsigned char c) { return *this = wxUniChar(c); }
#if wxWCHAR_T_IS_SEPARATE_TYPE #if wxWCHAR_T_IS_REAL_TYPE
wxUniCharRef& operator=(wchar_t c) { return *this = wxUniChar(c); } wxUniCharRef& operator=(wchar_t c) { return *this = wxUniChar(c); }
#endif #endif
wxUniCharRef& operator=(int c) { return *this = wxUniChar(c); } wxUniCharRef& operator=(int c) { return *this = wxUniChar(c); }
@@ -226,7 +208,7 @@ public:
// Conversions to the same types as wxUniChar is convertible too: // Conversions to the same types as wxUniChar is convertible too:
operator char() const { return UniChar(); } operator char() const { return UniChar(); }
operator unsigned char() const { return UniChar(); } operator unsigned char() const { return UniChar(); }
#if wxWCHAR_T_IS_SEPARATE_TYPE #if wxWCHAR_T_IS_REAL_TYPE
operator wchar_t() const { return UniChar(); } operator wchar_t() const { return UniChar(); }
#endif #endif
operator int() const { return UniChar(); } operator int() const { return UniChar(); }

View File

@@ -950,7 +950,7 @@
#undef wxSIZE_T_IS_ULONG #undef wxSIZE_T_IS_ULONG
/* Define if wchar_t is distinct type in your compiler. */ /* Define if wchar_t is distinct type in your compiler. */
#undef wxWCHAR_T_IS_SEPARATE_TYPE #undef wxWCHAR_T_IS_REAL_TYPE
/* Define if you have the dlopen function. */ /* Define if you have the dlopen function. */
#undef HAVE_DLOPEN #undef HAVE_DLOPEN

View File

@@ -1034,7 +1034,7 @@ typedef pid_t GPid;
#undef wxSIZE_T_IS_ULONG #undef wxSIZE_T_IS_ULONG
/* Define if wchar_t is distinct type in your compiler. */ /* Define if wchar_t is distinct type in your compiler. */
#define wxWCHAR_T_IS_SEPARATE_TYPE 1 #define wxWCHAR_T_IS_REAL_TYPE 1
/* Define if you have the dlopen function. */ /* Define if you have the dlopen function. */
#define HAVE_DLOPEN 1 #define HAVE_DLOPEN 1