1 // -*- C++ -*- 2 // Copyright (C) 2010-2013, Vaclav Haisman. All rights reserved. 3 // 4 // Redistribution and use in source and binary forms, with or without modifica- 5 // tion, are permitted provided that the following conditions are met: 6 // 7 // 1. Redistributions of source code must retain the above copyright notice, 8 // this list of conditions and the following disclaimer. 9 // 10 // 2. Redistributions in binary form must reproduce the above copyright notice, 11 // this list of conditions and the following disclaimer in the documentation 12 // and/or other materials provided with the distribution. 13 // 14 // THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, 15 // INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 16 // FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 17 // APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 18 // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU- 19 // DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS 20 // OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 21 // ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 23 // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 25 /** @file */ 26 27 #ifndef LOG4CPLUS_TCHAR_HEADER_ 28 #define LOG4CPLUS_TCHAR_HEADER_ 29 30 #include <log4cplus/config.hxx> 31 32 #if defined (LOG4CPLUS_HAVE_PRAGMA_ONCE) 33 #pragma once 34 #endif 35 36 #if defined (_WIN32) 37 #include <cstddef> 38 #endif 39 40 41 #ifdef UNICODE 42 # define LOG4CPLUS_TEXT2(STRING) L##STRING 43 #else 44 # define LOG4CPLUS_TEXT2(STRING) STRING 45 #endif // UNICODE 46 #define LOG4CPLUS_TEXT(STRING) LOG4CPLUS_TEXT2(STRING) 47 48 49 namespace log4cplus 50 { 51 52 #if defined (UNICODE) 53 typedef wchar_t tchar; 54 55 #else 56 typedef char tchar; 57 58 #endif 59 60 } // namespace log4cplus 61 62 63 #endif // LOG4CPLUS_TCHAR_HEADER_ 64