Just Launched: You can now import projects and releases from Google Code onto SourceForge
We are excited to release new functionality to enable a 1-click import from Google Code onto the Allura platform on SourceForge. You can import tickets, wikis, source, releases, and more with a few simple steps. Read More
I have read that MinGW doesn't support C++ wstring on Windows because it uses
the Windows run time which assumes wchar_t is 16 bits while g++ assumes
it's 32 bits. So be it.
However, I would like to write my C++ code so that it can make use of wstring
on other platforms.
My first (naive) attempt was to use
#define wstring string
when compiling on MinGW and Windows. However, the MinGW include files *DO*
typedef wstring based on other conditions. So, my #define caused that typedef
to redefine string, thereby causing an error.
Is there an accepted way of coding MinGW C++ strings so that they are wide
strings on platforms that support it and regular strings elsewhere?