This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

_GLIBCPP_USE_WCHAR_T undefined in FreeBSD's c++config.h?


Hi,

I am not sure if this issue falls under the jurisdiction of
the gcc@ or libstdc++@ mailing lists so I am posting to both.

I am running FreeBSD:
uname -a
FreeBSD 5.0-CURRENT #15



If I bootstrap gcc 3.3 branch, I notice that
include/c++/3.3/i386-unknown-freebsd5.0/bits/c++config.h
does not define _GLIBCPP_USE_WCHAR_T as it does under Linux.

This makes it impossible to compile the following snippet of
code:

#include <string>

using namespace std;

int main(int argc, char *argv[])
{
  std::wstring a;
  return 0;
}


a.cc: In function `int main(int, char**)':
a.cc:7: error: `wstring' undeclared in namespace `std'
a.cc:7: error: parse error before `;' token


The reason for this is because in include/c++/3.3/bits/stringfwd.h, 
we have:


#ifdef _GLIBCPP_USE_WCHAR_T
  template<> struct char_traits<wchar_t>;

  typedef basic_string<wchar_t> wstring;
#endif


What is the solution for this?

Thanks.
-- 
Craig Rodrigues        
http://home.attbi.com/~rodrigc
rodrigc at attbi dot com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]