3 Internal definitions used by Expat. This is not needed to compile
6 The following calling convention macros are defined for frequently
9 FASTCALL - Used for those internal functions that have a simple
10 body and a low number of arguments and local variables.
12 PTRCALL - Used for functions called though function pointers.
14 PTRFASTCALL - Like PTRCALL, but for low number of arguments.
16 inline - Used for selected internal functions for which inlining
17 may improve performance on some platforms.
19 Note: Use of these macros is based on judgement, not hard rules,
20 and therefore subject to change.
22 ___\ \/ /_ __ __ _| |_
23 / _ \\ /| '_ \ / _` | __|
24 | __// \| |_) | (_| | |_
25 \___/_/\_\ .__/ \__,_|\__|
28 Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
29 Copyright (c) 2000-2017 Expat development team
30 Licensed under the MIT license:
32 Permission is hereby granted, free of charge, to any person obtaining
33 a copy of this software and associated documentation files (the
34 "Software"), to deal in the Software without restriction, including
35 without limitation the rights to use, copy, modify, merge, publish,
36 distribute, sublicense, and/or sell copies of the Software, and to permit
37 persons to whom the Software is furnished to do so, subject to the
40 The above copyright notice and this permission notice shall be included
41 in all copies or substantial portions of the Software.
43 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
44 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
45 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
46 NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
47 DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
48 OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
49 USE OR OTHER DEALINGS IN THE SOFTWARE.
52 #if defined(__GNUC__) && defined(__i386__) && !defined(__MINGW32__)
53 /* We'll use this version by default only where we know it helps.
55 regparm() generates warnings on Solaris boxes. See SF bug #692878.
57 Instability reported with egcs on a RedHat Linux 7.3.
59 #define FASTCALL __attribute__((stdcall, regparm(3)))
62 #define FASTCALL __attribute__((regparm(3)))
63 #define PTRFASTCALL __attribute__((regparm(3)))
66 /* Using __fastcall seems to have an unexpected negative effect under
67 MS VC++, especially for function pointers, so we won't use it for
68 now on that platform. It may be reconsidered for a future release
69 if it can be made more effective.
70 Likely reason: __fastcall on Windows is like stdcall, therefore
71 the compiler cannot perform stack optimizations for call clusters.
74 /* Make sure all of these are defined if they aren't already. */
89 #if !defined(__cplusplus) && !defined(inline)
91 #define inline __inline
94 #endif /* XML_MIN_SIZE */
106 # define UNUSED_P(p) UNUSED_ ## p __attribute__((__unused__))
108 # define UNUSED_P(p) UNUSED_ ## p
119 _INTERNAL_trim_to_complete_utf8_characters(const char * from, const char ** fromLimRef);