/Modules/expat/internal.h

http://unladen-swallow.googlecode.com/ · C++ Header · 73 lines · 27 code · 8 blank · 38 comment · 2 complexity · c2154e3357cd4261bb343f221e90ffe8 MD5 · raw file

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