Mercurial > cpython-lru_cache-weakref
annotate Mac/Python/macgetcompiler.c @ 25838:8540887bcec6 2.2
Backport of 2.183:
Fix memory leak in add_subclass() found by NealN with valgrind.
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Fri, 18 Oct 2002 13:42:21 +0000 |
| parents | 7b1a0804161e |
| children | 4f9d5ea4f37d |
| rev | line source |
|---|---|
|
5079
d6b292a33cfe
Added/updated copyright notices
Jack Jansen <jack.jansen@cwi.nl>
parents:
4019
diff
changeset
|
1 /*********************************************************** |
|
d6b292a33cfe
Added/updated copyright notices
Jack Jansen <jack.jansen@cwi.nl>
parents:
4019
diff
changeset
|
2 Copyright 1991-1997 by Stichting Mathematisch Centrum, Amsterdam, |
|
d6b292a33cfe
Added/updated copyright notices
Jack Jansen <jack.jansen@cwi.nl>
parents:
4019
diff
changeset
|
3 The Netherlands. |
|
d6b292a33cfe
Added/updated copyright notices
Jack Jansen <jack.jansen@cwi.nl>
parents:
4019
diff
changeset
|
4 |
|
d6b292a33cfe
Added/updated copyright notices
Jack Jansen <jack.jansen@cwi.nl>
parents:
4019
diff
changeset
|
5 All Rights Reserved |
|
d6b292a33cfe
Added/updated copyright notices
Jack Jansen <jack.jansen@cwi.nl>
parents:
4019
diff
changeset
|
6 |
|
d6b292a33cfe
Added/updated copyright notices
Jack Jansen <jack.jansen@cwi.nl>
parents:
4019
diff
changeset
|
7 Permission to use, copy, modify, and distribute this software and its |
|
d6b292a33cfe
Added/updated copyright notices
Jack Jansen <jack.jansen@cwi.nl>
parents:
4019
diff
changeset
|
8 documentation for any purpose and without fee is hereby granted, |
|
d6b292a33cfe
Added/updated copyright notices
Jack Jansen <jack.jansen@cwi.nl>
parents:
4019
diff
changeset
|
9 provided that the above copyright notice appear in all copies and that |
|
d6b292a33cfe
Added/updated copyright notices
Jack Jansen <jack.jansen@cwi.nl>
parents:
4019
diff
changeset
|
10 both that copyright notice and this permission notice appear in |
|
d6b292a33cfe
Added/updated copyright notices
Jack Jansen <jack.jansen@cwi.nl>
parents:
4019
diff
changeset
|
11 supporting documentation, and that the names of Stichting Mathematisch |
|
d6b292a33cfe
Added/updated copyright notices
Jack Jansen <jack.jansen@cwi.nl>
parents:
4019
diff
changeset
|
12 Centrum or CWI or Corporation for National Research Initiatives or |
|
d6b292a33cfe
Added/updated copyright notices
Jack Jansen <jack.jansen@cwi.nl>
parents:
4019
diff
changeset
|
13 CNRI not be used in advertising or publicity pertaining to |
|
d6b292a33cfe
Added/updated copyright notices
Jack Jansen <jack.jansen@cwi.nl>
parents:
4019
diff
changeset
|
14 distribution of the software without specific, written prior |
|
d6b292a33cfe
Added/updated copyright notices
Jack Jansen <jack.jansen@cwi.nl>
parents:
4019
diff
changeset
|
15 permission. |
|
d6b292a33cfe
Added/updated copyright notices
Jack Jansen <jack.jansen@cwi.nl>
parents:
4019
diff
changeset
|
16 |
|
d6b292a33cfe
Added/updated copyright notices
Jack Jansen <jack.jansen@cwi.nl>
parents:
4019
diff
changeset
|
17 While CWI is the initial source for this software, a modified version |
|
d6b292a33cfe
Added/updated copyright notices
Jack Jansen <jack.jansen@cwi.nl>
parents:
4019
diff
changeset
|
18 is made available by the Corporation for National Research Initiatives |
|
d6b292a33cfe
Added/updated copyright notices
Jack Jansen <jack.jansen@cwi.nl>
parents:
4019
diff
changeset
|
19 (CNRI) at the Internet address ftp://ftp.python.org. |
|
d6b292a33cfe
Added/updated copyright notices
Jack Jansen <jack.jansen@cwi.nl>
parents:
4019
diff
changeset
|
20 |
|
d6b292a33cfe
Added/updated copyright notices
Jack Jansen <jack.jansen@cwi.nl>
parents:
4019
diff
changeset
|
21 STICHTING MATHEMATISCH CENTRUM AND CNRI DISCLAIM ALL WARRANTIES WITH |
|
d6b292a33cfe
Added/updated copyright notices
Jack Jansen <jack.jansen@cwi.nl>
parents:
4019
diff
changeset
|
22 REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF |
|
d6b292a33cfe
Added/updated copyright notices
Jack Jansen <jack.jansen@cwi.nl>
parents:
4019
diff
changeset
|
23 MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH |
|
d6b292a33cfe
Added/updated copyright notices
Jack Jansen <jack.jansen@cwi.nl>
parents:
4019
diff
changeset
|
24 CENTRUM OR CNRI BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL |
|
d6b292a33cfe
Added/updated copyright notices
Jack Jansen <jack.jansen@cwi.nl>
parents:
4019
diff
changeset
|
25 DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR |
|
d6b292a33cfe
Added/updated copyright notices
Jack Jansen <jack.jansen@cwi.nl>
parents:
4019
diff
changeset
|
26 PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER |
|
d6b292a33cfe
Added/updated copyright notices
Jack Jansen <jack.jansen@cwi.nl>
parents:
4019
diff
changeset
|
27 TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR |
|
d6b292a33cfe
Added/updated copyright notices
Jack Jansen <jack.jansen@cwi.nl>
parents:
4019
diff
changeset
|
28 PERFORMANCE OF THIS SOFTWARE. |
|
d6b292a33cfe
Added/updated copyright notices
Jack Jansen <jack.jansen@cwi.nl>
parents:
4019
diff
changeset
|
29 |
|
d6b292a33cfe
Added/updated copyright notices
Jack Jansen <jack.jansen@cwi.nl>
parents:
4019
diff
changeset
|
30 ******************************************************************/ |
|
d6b292a33cfe
Added/updated copyright notices
Jack Jansen <jack.jansen@cwi.nl>
parents:
4019
diff
changeset
|
31 |
| 2930 | 32 /* Return a string representing the compiler name */ |
| 33 | |
|
18849
77fd20bcc766
config.h renamed to pyconfig.h
Jack Jansen <jack.jansen@cwi.nl>
parents:
16646
diff
changeset
|
34 #include "pyconfig.h" |
|
13547
db963a615bc9
ANSIfication step 2: make sure all needed prototypes are available, and all needed
Jack Jansen <jack.jansen@cwi.nl>
parents:
12853
diff
changeset
|
35 #include "Python.h" |
| 4019 | 36 |
| 2930 | 37 #ifdef __MWERKS__ |
|
12281
51c0c3b6d919
Started on GUSI2 and threading support.
Jack Jansen <jack.jansen@cwi.nl>
parents:
5270
diff
changeset
|
38 #ifdef USE_GUSI1 |
|
16646
b9e5481f644c
Made version string shorter for Carbon so it fits on one line.
Jack Jansen <jack.jansen@cwi.nl>
parents:
13608
diff
changeset
|
39 #define HASGUSI " GUSI1" |
|
12281
51c0c3b6d919
Started on GUSI2 and threading support.
Jack Jansen <jack.jansen@cwi.nl>
parents:
5270
diff
changeset
|
40 #else |
|
51c0c3b6d919
Started on GUSI2 and threading support.
Jack Jansen <jack.jansen@cwi.nl>
parents:
5270
diff
changeset
|
41 #ifdef USE_GUSI2 |
|
16646
b9e5481f644c
Made version string shorter for Carbon so it fits on one line.
Jack Jansen <jack.jansen@cwi.nl>
parents:
13608
diff
changeset
|
42 #define HASGUSI " GUSI2" |
| 3394 | 43 #else |
| 44 #define HASGUSI "" | |
| 45 #endif | |
|
12281
51c0c3b6d919
Started on GUSI2 and threading support.
Jack Jansen <jack.jansen@cwi.nl>
parents:
5270
diff
changeset
|
46 #endif |
|
51c0c3b6d919
Started on GUSI2 and threading support.
Jack Jansen <jack.jansen@cwi.nl>
parents:
5270
diff
changeset
|
47 |
|
51c0c3b6d919
Started on GUSI2 and threading support.
Jack Jansen <jack.jansen@cwi.nl>
parents:
5270
diff
changeset
|
48 #ifdef WITH_THREAD |
|
16646
b9e5481f644c
Made version string shorter for Carbon so it fits on one line.
Jack Jansen <jack.jansen@cwi.nl>
parents:
13608
diff
changeset
|
49 #define HASTHREAD " THREADS" |
|
12281
51c0c3b6d919
Started on GUSI2 and threading support.
Jack Jansen <jack.jansen@cwi.nl>
parents:
5270
diff
changeset
|
50 #else |
|
51c0c3b6d919
Started on GUSI2 and threading support.
Jack Jansen <jack.jansen@cwi.nl>
parents:
5270
diff
changeset
|
51 #define HASTHREAD "" |
|
51c0c3b6d919
Started on GUSI2 and threading support.
Jack Jansen <jack.jansen@cwi.nl>
parents:
5270
diff
changeset
|
52 #endif |
|
51c0c3b6d919
Started on GUSI2 and threading support.
Jack Jansen <jack.jansen@cwi.nl>
parents:
5270
diff
changeset
|
53 |
|
13608
a901c2c0166b
Test for TARGET_API_MAC_CARBON with #if in stead of #ifdef.
Jack Jansen <jack.jansen@cwi.nl>
parents:
13553
diff
changeset
|
54 #if TARGET_API_MAC_CARBON |
|
12853
21553bd2e875
Removed THINK_C support.
Jack Jansen <jack.jansen@cwi.nl>
parents:
12590
diff
changeset
|
55 #define TARGET_API " CARBON" |
|
21553bd2e875
Removed THINK_C support.
Jack Jansen <jack.jansen@cwi.nl>
parents:
12590
diff
changeset
|
56 #else |
|
16646
b9e5481f644c
Made version string shorter for Carbon so it fits on one line.
Jack Jansen <jack.jansen@cwi.nl>
parents:
13608
diff
changeset
|
57 #define TARGET_API " PPC" |
|
12853
21553bd2e875
Removed THINK_C support.
Jack Jansen <jack.jansen@cwi.nl>
parents:
12590
diff
changeset
|
58 #endif |
|
21553bd2e875
Removed THINK_C support.
Jack Jansen <jack.jansen@cwi.nl>
parents:
12590
diff
changeset
|
59 |
|
19023
7b1a0804161e
Bit the bullet and enabled garbage collection (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents:
18849
diff
changeset
|
60 #ifdef WITH_CYCLE_GC |
|
7b1a0804161e
Bit the bullet and enabled garbage collection (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents:
18849
diff
changeset
|
61 #define HASGC " GC" |
|
7b1a0804161e
Bit the bullet and enabled garbage collection (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents:
18849
diff
changeset
|
62 #else |
|
7b1a0804161e
Bit the bullet and enabled garbage collection (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents:
18849
diff
changeset
|
63 #define HASGC "" |
|
7b1a0804161e
Bit the bullet and enabled garbage collection (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents:
18849
diff
changeset
|
64 #endif |
|
7b1a0804161e
Bit the bullet and enabled garbage collection (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents:
18849
diff
changeset
|
65 |
|
7b1a0804161e
Bit the bullet and enabled garbage collection (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents:
18849
diff
changeset
|
66 #define COMPILER " [CW" TARGET_API HASGUSI HASTHREAD HASGC"]" |
|
2983
7b3911960564
Merged Jack's macgetcompiler.c and Guido's maccompiler.c and named the
Jack Jansen <jack.jansen@cwi.nl>
parents:
2930
diff
changeset
|
67 #endif |
| 2930 | 68 |
| 69 #ifdef MPW | |
| 70 #define COMPILER " [Apple MPW]" | |
| 71 #endif | |
| 72 | |
|
13547
db963a615bc9
ANSIfication step 2: make sure all needed prototypes are available, and all needed
Jack Jansen <jack.jansen@cwi.nl>
parents:
12853
diff
changeset
|
73 const char * |
|
db963a615bc9
ANSIfication step 2: make sure all needed prototypes are available, and all needed
Jack Jansen <jack.jansen@cwi.nl>
parents:
12853
diff
changeset
|
74 Py_GetCompiler(void) |
| 2930 | 75 { |
| 76 return COMPILER; | |
| 77 } |
