I have Linux code and I want to port it to Windows. The code uses Glib::ustring, but I want to replace all the strings to std::wstring for testing purposes.
Is there a way to define all Glib::string to std::wstring without changing it in code? Something similar to typedef or #define?
What makes you think that
Glib::ustringis interchangeable/interoperable withstd::wstring? Most likely if you made that substitution you’d just get a bunch of compiler errors, or if you’re unlucky it would compile and run with different semantics.I think you’re going to have to bite the bullet and convert your Linux code to use
wstringfirst and then the Windows port should be a lot less complicated.That said, assuming you don’t need
Glibin the Windows version you could remove all references to that and then create your own fake type in a header: