michael@0: /* internal.h michael@0: michael@0: Internal definitions used by Expat. This is not needed to compile michael@0: client code. michael@0: michael@0: The following calling convention macros are defined for frequently michael@0: called functions: michael@0: michael@0: FASTCALL - Used for those internal functions that have a simple michael@0: body and a low number of arguments and local variables. michael@0: michael@0: PTRCALL - Used for functions called though function pointers. michael@0: michael@0: PTRFASTCALL - Like PTRCALL, but for low number of arguments. michael@0: michael@0: inline - Used for selected internal functions for which inlining michael@0: may improve performance on some platforms. michael@0: michael@0: Note: Use of these macros is based on judgment, not hard rules, michael@0: and therefore subject to change. michael@0: */ michael@0: michael@0: #if defined(__GNUC__) && defined(__i386__) michael@0: /* We'll use this version by default only where we know it helps. michael@0: michael@0: regparm() generates warnings on Solaris boxes. See SF bug #692878. michael@0: michael@0: Instability reported with egcs on a RedHat Linux 7.3. michael@0: Let's comment out: michael@0: #define FASTCALL __attribute__((stdcall, regparm(3))) michael@0: and let's try this: michael@0: */ michael@0: #define FASTCALL __attribute__((regparm(3))) michael@0: #define PTRFASTCALL __attribute__((regparm(3))) michael@0: #endif michael@0: michael@0: /* Using __fastcall seems to have an unexpected negative effect under michael@0: MS VC++, especially for function pointers, so we won't use it for michael@0: now on that platform. It may be reconsidered for a future release michael@0: if it can be made more effective. michael@0: Likely reason: __fastcall on Windows is like stdcall, therefore michael@0: the compiler cannot perform stack optimizations for call clusters. michael@0: */ michael@0: michael@0: /* Make sure all of these are defined if they aren't already. */ michael@0: michael@0: #ifndef FASTCALL michael@0: #define FASTCALL michael@0: #endif michael@0: michael@0: #ifndef PTRCALL michael@0: #define PTRCALL michael@0: #endif michael@0: michael@0: #ifndef PTRFASTCALL michael@0: #define PTRFASTCALL michael@0: #endif michael@0: michael@0: #ifndef XML_MIN_SIZE michael@0: #if !defined(__cplusplus) && !defined(inline) michael@0: #ifdef __GNUC__ michael@0: #define inline __inline michael@0: #endif /* __GNUC__ */ michael@0: #endif michael@0: #endif /* XML_MIN_SIZE */ michael@0: michael@0: #ifdef __cplusplus michael@0: #define inline inline michael@0: #else michael@0: #ifndef inline michael@0: #define inline michael@0: #endif michael@0: #endif