Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | /* internal.h |
michael@0 | 2 | |
michael@0 | 3 | Internal definitions used by Expat. This is not needed to compile |
michael@0 | 4 | client code. |
michael@0 | 5 | |
michael@0 | 6 | The following calling convention macros are defined for frequently |
michael@0 | 7 | called functions: |
michael@0 | 8 | |
michael@0 | 9 | FASTCALL - Used for those internal functions that have a simple |
michael@0 | 10 | body and a low number of arguments and local variables. |
michael@0 | 11 | |
michael@0 | 12 | PTRCALL - Used for functions called though function pointers. |
michael@0 | 13 | |
michael@0 | 14 | PTRFASTCALL - Like PTRCALL, but for low number of arguments. |
michael@0 | 15 | |
michael@0 | 16 | inline - Used for selected internal functions for which inlining |
michael@0 | 17 | may improve performance on some platforms. |
michael@0 | 18 | |
michael@0 | 19 | Note: Use of these macros is based on judgment, not hard rules, |
michael@0 | 20 | and therefore subject to change. |
michael@0 | 21 | */ |
michael@0 | 22 | |
michael@0 | 23 | #if defined(__GNUC__) && defined(__i386__) |
michael@0 | 24 | /* We'll use this version by default only where we know it helps. |
michael@0 | 25 | |
michael@0 | 26 | regparm() generates warnings on Solaris boxes. See SF bug #692878. |
michael@0 | 27 | |
michael@0 | 28 | Instability reported with egcs on a RedHat Linux 7.3. |
michael@0 | 29 | Let's comment out: |
michael@0 | 30 | #define FASTCALL __attribute__((stdcall, regparm(3))) |
michael@0 | 31 | and let's try this: |
michael@0 | 32 | */ |
michael@0 | 33 | #define FASTCALL __attribute__((regparm(3))) |
michael@0 | 34 | #define PTRFASTCALL __attribute__((regparm(3))) |
michael@0 | 35 | #endif |
michael@0 | 36 | |
michael@0 | 37 | /* Using __fastcall seems to have an unexpected negative effect under |
michael@0 | 38 | MS VC++, especially for function pointers, so we won't use it for |
michael@0 | 39 | now on that platform. It may be reconsidered for a future release |
michael@0 | 40 | if it can be made more effective. |
michael@0 | 41 | Likely reason: __fastcall on Windows is like stdcall, therefore |
michael@0 | 42 | the compiler cannot perform stack optimizations for call clusters. |
michael@0 | 43 | */ |
michael@0 | 44 | |
michael@0 | 45 | /* Make sure all of these are defined if they aren't already. */ |
michael@0 | 46 | |
michael@0 | 47 | #ifndef FASTCALL |
michael@0 | 48 | #define FASTCALL |
michael@0 | 49 | #endif |
michael@0 | 50 | |
michael@0 | 51 | #ifndef PTRCALL |
michael@0 | 52 | #define PTRCALL |
michael@0 | 53 | #endif |
michael@0 | 54 | |
michael@0 | 55 | #ifndef PTRFASTCALL |
michael@0 | 56 | #define PTRFASTCALL |
michael@0 | 57 | #endif |
michael@0 | 58 | |
michael@0 | 59 | #ifndef XML_MIN_SIZE |
michael@0 | 60 | #if !defined(__cplusplus) && !defined(inline) |
michael@0 | 61 | #ifdef __GNUC__ |
michael@0 | 62 | #define inline __inline |
michael@0 | 63 | #endif /* __GNUC__ */ |
michael@0 | 64 | #endif |
michael@0 | 65 | #endif /* XML_MIN_SIZE */ |
michael@0 | 66 | |
michael@0 | 67 | #ifdef __cplusplus |
michael@0 | 68 | #define inline inline |
michael@0 | 69 | #else |
michael@0 | 70 | #ifndef inline |
michael@0 | 71 | #define inline |
michael@0 | 72 | #endif |
michael@0 | 73 | #endif |