annotate Modules/expat/internal.h @ 54294:dba767bc3155 legacy-trunk

remove mention of old ctypes version
author Benjamin Peterson <benjamin@python.org>
date Sat, 23 May 2009 20:59:09 +0000
parents 6248dd5d192a
children e4dc8be9a72f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
27384
d363f83c2846 Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
1 /* internal.h
d363f83c2846 Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
2
d363f83c2846 Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
3 Internal definitions used by Expat. This is not needed to compile
d363f83c2846 Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
4 client code.
d363f83c2846 Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
5
d363f83c2846 Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
6 The following calling convention macros are defined for frequently
d363f83c2846 Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
7 called functions:
d363f83c2846 Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
8
d363f83c2846 Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
9 FASTCALL - Used for those internal functions that have a simple
d363f83c2846 Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
10 body and a low number of arguments and local variables.
d363f83c2846 Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
11
d363f83c2846 Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
12 PTRCALL - Used for functions called though function pointers.
d363f83c2846 Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
13
d363f83c2846 Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
14 PTRFASTCALL - Like PTRCALL, but for low number of arguments.
d363f83c2846 Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
15
d363f83c2846 Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
16 inline - Used for selected internal functions for which inlining
d363f83c2846 Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
17 may improve performance on some platforms.
d363f83c2846 Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
18
d363f83c2846 Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
19 Note: Use of these macros is based on judgement, not hard rules,
d363f83c2846 Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
20 and therefore subject to change.
d363f83c2846 Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
21 */
d363f83c2846 Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
22
30748
6248dd5d192a Update to Expat 1.95.7; there are no changes to the Expat sources.
Fred Drake <fdrake@acm.org>
parents: 27384
diff changeset
23 #if defined(__GNUC__) && defined(__i386__)
6248dd5d192a Update to Expat 1.95.7; there are no changes to the Expat sources.
Fred Drake <fdrake@acm.org>
parents: 27384
diff changeset
24 /* We'll use this version by default only where we know it helps.
6248dd5d192a Update to Expat 1.95.7; there are no changes to the Expat sources.
Fred Drake <fdrake@acm.org>
parents: 27384
diff changeset
25
6248dd5d192a Update to Expat 1.95.7; there are no changes to the Expat sources.
Fred Drake <fdrake@acm.org>
parents: 27384
diff changeset
26 regparm() generates warnings on Solaris boxes. See SF bug #692878.
6248dd5d192a Update to Expat 1.95.7; there are no changes to the Expat sources.
Fred Drake <fdrake@acm.org>
parents: 27384
diff changeset
27
6248dd5d192a Update to Expat 1.95.7; there are no changes to the Expat sources.
Fred Drake <fdrake@acm.org>
parents: 27384
diff changeset
28 Instability reported with egcs on a RedHat Linux 7.3.
6248dd5d192a Update to Expat 1.95.7; there are no changes to the Expat sources.
Fred Drake <fdrake@acm.org>
parents: 27384
diff changeset
29 Let's comment out:
27384
d363f83c2846 Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
30 #define FASTCALL __attribute__((stdcall, regparm(3)))
d363f83c2846 Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
31 and let's try this:
d363f83c2846 Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
32 */
d363f83c2846 Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
33 #define FASTCALL __attribute__((regparm(3)))
d363f83c2846 Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
34 #define PTRFASTCALL __attribute__((regparm(3)))
30748
6248dd5d192a Update to Expat 1.95.7; there are no changes to the Expat sources.
Fred Drake <fdrake@acm.org>
parents: 27384
diff changeset
35 #endif
27384
d363f83c2846 Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
36
d363f83c2846 Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
37 /* Using __fastcall seems to have an unexpected negative effect under
d363f83c2846 Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
38 MS VC++, especially for function pointers, so we won't use it for
d363f83c2846 Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
39 now on that platform. It may be reconsidered for a future release
d363f83c2846 Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
40 if it can be made more effective.
d363f83c2846 Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
41 Likely reason: __fastcall on Windows is like stdcall, therefore
d363f83c2846 Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
42 the compiler cannot perform stack optimizations for call clusters.
d363f83c2846 Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
43 */
d363f83c2846 Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
44
30748
6248dd5d192a Update to Expat 1.95.7; there are no changes to the Expat sources.
Fred Drake <fdrake@acm.org>
parents: 27384
diff changeset
45 /* Make sure all of these are defined if they aren't already. */
27384
d363f83c2846 Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
46
d363f83c2846 Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
47 #ifndef FASTCALL
d363f83c2846 Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
48 #define FASTCALL
d363f83c2846 Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
49 #endif
d363f83c2846 Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
50
d363f83c2846 Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
51 #ifndef PTRCALL
d363f83c2846 Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
52 #define PTRCALL
d363f83c2846 Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
53 #endif
d363f83c2846 Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
54
d363f83c2846 Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
55 #ifndef PTRFASTCALL
d363f83c2846 Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
56 #define PTRFASTCALL
d363f83c2846 Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
57 #endif
d363f83c2846 Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
58
d363f83c2846 Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
59 #ifndef XML_MIN_SIZE
d363f83c2846 Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
60 #if !defined(__cplusplus) && !defined(inline)
d363f83c2846 Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
61 #ifdef __GNUC__
d363f83c2846 Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
62 #define inline __inline
d363f83c2846 Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
63 #endif /* __GNUC__ */
d363f83c2846 Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
64 #endif
d363f83c2846 Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
65 #endif /* XML_MIN_SIZE */
d363f83c2846 Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
66
d363f83c2846 Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
67 #ifdef __cplusplus
d363f83c2846 Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
68 #define inline inline
d363f83c2846 Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
69 #else
d363f83c2846 Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
70 #ifndef inline
d363f83c2846 Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
71 #define inline
d363f83c2846 Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
72 #endif
d363f83c2846 Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
73 #endif