| 1 | /* internal.h |
| 2 | |
| 3 | Internal definitions used by Expat. This is not needed to compile |
| 4 | client code. |
| 5 | |
| 6 | The following calling convention macros are defined for frequently |
| 7 | called functions: |
| 8 | |
| 9 | FASTCALL - Used for those internal functions that have a simple |
| 10 | body and a low number of arguments and local variables. |
| 11 | |
| 12 | PTRCALL - Used for functions called though function pointers. |
| 13 | |
| 14 | PTRFASTCALL - Like PTRCALL, but for low number of arguments. |
| 15 | |
| 16 | inline - Used for selected internal functions for which inlining |
| 17 | may improve performance on some platforms. |
| 18 | |
| 19 | Note: Use of these macros is based on judgement, not hard rules, |
| 20 | and therefore subject to change. |
| 21 | __ __ _ |
| 22 | ___\ \/ /_ __ __ _| |_ |
| 23 | / _ \\ /| '_ \ / _` | __| |
| 24 | | __// \| |_) | (_| | |_ |
| 25 | \___/_/\_\ .__/ \__,_|\__| |
| 26 | |_| XML parser |
| 27 | |
| 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: |
| 31 | |
| 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 |
| 38 | following conditions: |
| 39 | |
| 40 | The above copyright notice and this permission notice shall be included |
| 41 | in all copies or substantial portions of the Software. |
| 42 | |
| 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. |
| 50 | */ |
| 51 | |
| 52 | #if defined(__GNUC__) && defined(__i386__) && ! defined(__MINGW32__) |
| 53 | /* We'll use this version by default only where we know it helps. |
| 54 | |
| 55 | regparm() generates warnings on Solaris boxes. See SF bug #692878. |
| 56 | |
| 57 | Instability reported with egcs on a RedHat Linux 7.3. |
| 58 | Let's comment out: |
| 59 | #define FASTCALL __attribute__((stdcall, regparm(3))) |
| 60 | and let's try this: |
| 61 | */ |
| 62 | # define FASTCALL __attribute__((regparm(3))) |
| 63 | # define PTRFASTCALL __attribute__((regparm(3))) |
| 64 | #endif |
| 65 | |
| 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. |
| 72 | */ |
| 73 | |
| 74 | /* Make sure all of these are defined if they aren't already. */ |
| 75 | |
| 76 | #ifndef FASTCALL |
| 77 | # define FASTCALL |
| 78 | #endif |
| 79 | |
| 80 | #ifndef PTRCALL |
| 81 | # define PTRCALL |
| 82 | #endif |
| 83 | |
| 84 | #ifndef PTRFASTCALL |
| 85 | # define PTRFASTCALL |
| 86 | #endif |
| 87 | |
| 88 | #ifndef XML_MIN_SIZE |
| 89 | # if ! defined(__cplusplus) && ! defined(inline) |
| 90 | # ifdef __GNUC__ |
| 91 | # define inline __inline |
| 92 | # endif /* __GNUC__ */ |
| 93 | # endif |
| 94 | #endif /* XML_MIN_SIZE */ |
| 95 | |
| 96 | #ifdef __cplusplus |
| 97 | # define inline inline |
| 98 | #else |
| 99 | # ifndef inline |
| 100 | # define inline |
| 101 | # endif |
| 102 | #endif |
| 103 | |
| 104 | #ifndef UNUSED_P |
| 105 | # define UNUSED_P(p) (void)p |
| 106 | #endif |
| 107 | |
| 108 | #ifdef __cplusplus |
| 109 | extern "C" { |
| 110 | #endif |
| 111 | |
| 112 | #ifdef XML_ENABLE_VISIBILITY |
| 113 | # if XML_ENABLE_VISIBILITY |
| 114 | __attribute__((visibility("default"))) |
| 115 | # endif |
| 116 | #endif |
| 117 | void |
| 118 | _INTERNAL_trim_to_complete_utf8_characters(const char *from, |
| 119 | const char **fromLimRef); |
| 120 | |
| 121 | #ifdef __cplusplus |
| 122 | } |
| 123 | #endif |