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