1 /* 2 * The MIT License (MIT) 3 * This file is part of waifu2x-converter-cpp 4 * 5 * Permission is hereby granted, free of charge, to any person obtaining a copy 6 * of this software and associated documentation files (the "Software"), to deal 7 * in the Software without restriction, including without limitation the rights 8 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 * copies of the Software, and to permit persons to whom the Software is 10 * furnished to do so, subject to the following conditions: 11 * 12 * The above copyright notice and this permission notice shall be included in all 13 * copies or substantial portions of the Software. 14 * 15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 * SOFTWARE. 22 */ 23 24 #ifndef __TCHAR_H__ 25 #define __TCHAR_H__ 26 27 #if defined(_WIN32) && defined(_UNICODE) 28 #define _T(x) L ## x 29 #else 30 #define _T(x) x 31 #endif 32 33 34 #if defined(_WIN32) && defined(_UNICODE) 35 #define _tmain wmain 36 #define _tcslen wcslen 37 #define _tcscat wcscat 38 #define _tcschr wcschr 39 #define _tcscpy wcscpy 40 #define _tcsncpy wcsncpy 41 #define _tcscmp wcscmp 42 #define _tcsncmp wcsncmp 43 #define _tcsstr wcsstr 44 #define _tcsrev _wcsrev 45 #define _tprintf wprintf 46 #define _stprintf swprintf 47 #define _tscanf wscanf 48 #define _tfopen _wfopen 49 #define _fgetts fgetws 50 #define _fputts fputws 51 #define _totlower towlower 52 #define _to_tstring to_wstring 53 #else 54 #define _tmain main 55 #define _tcslen strlen 56 #define _tcscat strcat 57 #define _tcschr strchr 58 #define _tcscpy strcpy 59 #define _tcsncpy strncpy 60 #define _tcscmp strcmp 61 #define _tcsncmp strncmp 62 #define _tcsstr strstr 63 #define _tcsrev strrev 64 #define _tprintf printf 65 #define _stprintf sprintf 66 #define _tscanf scanf 67 #define _tfopen fopen 68 #define _fgetts fgets 69 #define _fputts fputs 70 #define _totlower tolower 71 #define _to_tstring to_string 72 #endif 73 74 #if defined(_WIN32) && defined(_UNICODE) 75 typedef wchar_t TCHAR; 76 #else 77 typedef char TCHAR; 78 #endif 79 80 #endif 81