xref: /freebsd/contrib/expat/xmlwf/xmltchar.h (revision f81cdf24ba5436367377f7c8e8f51f6df2a75ca7)
1 /*
2                             __  __            _
3                          ___\ \/ /_ __   __ _| |_
4                         / _ \\  /| '_ \ / _` | __|
5                        |  __//  \| |_) | (_| | |_
6                         \___/_/\_\ .__/ \__,_|\__|
7                                  |_| XML parser
8 
9    Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
10    Copyright (c) 2016-2021 Sebastian Pipping <sebastian@pipping.org>
11    Copyright (c) 2017      Rhodri James <rhodri@wildebeest.org.uk>
12    Licensed under the MIT license:
13 
14    Permission is  hereby granted,  free of charge,  to any  person obtaining
15    a  copy  of  this  software   and  associated  documentation  files  (the
16    "Software"),  to  deal in  the  Software  without restriction,  including
17    without  limitation the  rights  to use,  copy,  modify, merge,  publish,
18    distribute, sublicense, and/or sell copies of the Software, and to permit
19    persons  to whom  the Software  is  furnished to  do so,  subject to  the
20    following conditions:
21 
22    The above copyright  notice and this permission notice  shall be included
23    in all copies or substantial portions of the Software.
24 
25    THE  SOFTWARE  IS  PROVIDED  "AS  IS",  WITHOUT  WARRANTY  OF  ANY  KIND,
26    EXPRESS  OR IMPLIED,  INCLUDING  BUT  NOT LIMITED  TO  THE WARRANTIES  OF
27    MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
28    NO EVENT SHALL THE AUTHORS OR  COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
29    DAMAGES OR  OTHER LIABILITY, WHETHER  IN AN  ACTION OF CONTRACT,  TORT OR
30    OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
31    USE OR OTHER DEALINGS IN THE SOFTWARE.
32 */
33 
34 /* Ensures compile-time constants are consistent */
35 #include "expat_external.h"
36 
37 #ifdef XML_UNICODE
38 #  ifndef XML_UNICODE_WCHAR_T
39 #    error xmlwf requires a 16-bit Unicode-compatible wchar_t
40 #  endif
41 #  define _PREPEND_BIG_L(x) L##x
42 #  define T(x) _PREPEND_BIG_L(x)
43 #  define ftprintf fwprintf
44 #  define tfopen _wfopen
45 #  define fputts fputws
46 #  define puttc putwc
47 #  define tcscmp wcscmp
48 #  define tcscpy wcscpy
49 #  define tcscat wcscat
50 #  define tcschr wcschr
51 #  define tcsrchr wcsrchr
52 #  define tcslen wcslen
53 #  define tperror _wperror
54 #  define topen _wopen
55 #  define tmain wmain
56 #  define tremove _wremove
57 #  define tchar wchar_t
58 #  define tcstof wcstof
59 #  define tcstoull wcstoull
60 #else /* not XML_UNICODE */
61 #  define T(x) x
62 #  define ftprintf fprintf
63 #  define tfopen fopen
64 #  define fputts fputs
65 #  define puttc putc
66 #  define tcscmp strcmp
67 #  define tcscpy strcpy
68 #  define tcscat strcat
69 #  define tcschr strchr
70 #  define tcsrchr strrchr
71 #  define tcslen strlen
72 #  define tperror perror
73 #  define topen open
74 #  define tmain main
75 #  define tremove remove
76 #  define tchar char
77 #  define tcstof strtof
78 #  define tcstoull strtoull
79 #endif /* not XML_UNICODE */
80