2009-04-18 19:00:33 +02:00
|
|
|
/* Copyright (C) 2009 Wildfire Games.
|
|
|
|
* This file is part of 0 A.D.
|
|
|
|
*
|
|
|
|
* 0 A.D. is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* 0 A.D. is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with 0 A.D. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2004-06-11 04:18:11 +02:00
|
|
|
// Make sure we have the argument (UNIDOUBLER_HEADER), and that we're not
|
|
|
|
// called from within another unidoubler execution (now that's just asking for
|
|
|
|
// trouble)
|
|
|
|
#if defined(UNIDOUBLER_HEADER) && !defined(IN_UNIDOUBLER)
|
|
|
|
|
|
|
|
#define IN_UNIDOUBLER
|
|
|
|
|
2005-06-01 22:12:45 +02:00
|
|
|
// When compiling CStr.cpp with PCH, the unidoubler stuff gets rather
|
|
|
|
// confusing because of all the nested inclusions, but this makes it work:
|
2004-06-11 04:18:11 +02:00
|
|
|
#undef CStr
|
2005-06-01 22:12:45 +02:00
|
|
|
|
|
|
|
// First, set up the environment for the Unicode version
|
|
|
|
#define _UNICODE
|
2004-07-10 20:58:09 +02:00
|
|
|
#define CStr CStrW
|
2005-06-01 22:12:45 +02:00
|
|
|
#define tstring wstring
|
|
|
|
#define tchar wchar_t
|
|
|
|
#define _T(t) L ## t
|
|
|
|
|
|
|
|
// Include the unidoubled file
|
2004-06-11 04:18:11 +02:00
|
|
|
#include UNIDOUBLER_HEADER
|
|
|
|
|
2005-06-01 22:12:45 +02:00
|
|
|
// Clean up all the macros
|
|
|
|
#undef _UNICODE
|
|
|
|
#undef CStr
|
2004-06-11 04:18:11 +02:00
|
|
|
#undef tstring
|
2005-06-01 22:12:45 +02:00
|
|
|
#undef tchar
|
2004-06-11 04:18:11 +02:00
|
|
|
#undef _T
|
2005-06-01 22:12:45 +02:00
|
|
|
|
2004-06-11 04:18:11 +02:00
|
|
|
|
|
|
|
// Now include the 8-bit version under the name CStr8
|
2005-06-01 22:12:45 +02:00
|
|
|
#define CStr CStr8
|
|
|
|
#define tstring string
|
|
|
|
#define tchar char
|
|
|
|
#define _T(t) t
|
|
|
|
|
|
|
|
#include UNIDOUBLER_HEADER
|
|
|
|
|
|
|
|
// Clean up the macros again, to minimise namespace pollution
|
2004-06-11 04:18:11 +02:00
|
|
|
#undef CStr
|
2005-06-01 22:12:45 +02:00
|
|
|
#undef tstring
|
|
|
|
#undef tchar
|
|
|
|
#undef _T
|
|
|
|
|
|
|
|
|
|
|
|
// To please the file that originally include CStr.h, make CStr an alias for CStr8:
|
2004-06-11 04:18:11 +02:00
|
|
|
#define CStr CStr8
|
|
|
|
|
|
|
|
#undef IN_UNIDOUBLER
|
|
|
|
#undef UNIDOUBLER_HEADER
|
|
|
|
|
2004-06-18 20:56:10 +02:00
|
|
|
#endif
|