From 38d0bdb06884849f285d91cde454e8a290bac0f0 Mon Sep 17 00:00:00 2001 From: Giovanni Bajo Date: Sun, 25 Jan 2004 16:26:41 +0000 Subject: [PATCH] Improve code to detect if wchar_t is a native type [SVN r21919] --- include/boost/config/compiler/intel.hpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/include/boost/config/compiler/intel.hpp b/include/boost/config/compiler/intel.hpp index 22890ca7..1f4f14c2 100644 --- a/include/boost/config/compiler/intel.hpp +++ b/include/boost/config/compiler/intel.hpp @@ -65,9 +65,15 @@ #if BOOST_INTEL_CXX_VERSION < 700 # define BOOST_NO_INTRINSIC_WCHAR_T #else -// _WCHAR_T_DEFINED is the Win32 spelling -// _WCHAR_T is the Linux spelling -# if !defined(_WCHAR_T_DEFINED) && !defined(_WCHAR_T) +// We should test the macro _WCHAR_T_DEFINED to check if the compiler +// supports wchar_t natively. *BUT* there is a problem here: the standard +// headers define this macro if they typedef wchar_t. Anyway, we're lucky +// because they define it without a value, while Intel C++ defines it +// to 1. So we can check its value to see if the macro was defined natively +// or not. +// Under UNIX, the situation is exactly the same, but the macro _WCHAR_T +// is used instead. +# if ((_WCHAR_T_DEFINED + 0) == 0)) && ((_WCHAR_T + 0) == 0) # define BOOST_NO_INTRINSIC_WCHAR_T # endif #endif