diff options
author | Frederic Weisbecker <fweisbec@gmail.com> | 2011-02-25 15:30:16 -0500 |
---|---|---|
committer | Frederic Weisbecker <fweisbec@gmail.com> | 2011-03-03 19:17:27 -0500 |
commit | cfff2d909cbdaf8c467bd321aa0502a548ec8f7e (patch) | |
tree | 562a4138cd66df7b5dcd6128aeb8d835a3da5436 /tools | |
parent | ff9ae1babd8ce88c3f90db6278ea5f55bdcb4624 (diff) |
perf: Fix undefined PyVarObject_HEAD_INIT in python 2.5
PyVarObject_HEAD_INIT is undefined in python 2.5, resulting
in a build crash:
util/python.c:81: attention : déclaration implicite de la fonction « «PyVarObject_HEAD_INIT» »
util/python.c:82: erreur: request for member «tp_name» in something not a structure or union
util/python.c:117: erreur: request for member «tp_name» in something not a structure or union
util/python.c:146: erreur: request for member «tp_name» in something not a structure or union
util/python.c:177: erreur: request for member «tp_name» in something not a structure or union
util/python.c:290: erreur: request for member «tp_name» in something not a structure or union
util/python.c:359: erreur: request for member «tp_name» in something not a structure or union
util/python.c:532: erreur: request for member «tp_name» in something not a structure or union
util/python.c:761: erreur: request for member «tp_name» in something not a structure or union
error: command 'gcc' failed with exit status 1
make: *** [python/perf.so] Erreur 1
We can fix that by defining PyVarObject_HEAD_INIT as a wrapper on
PyObject_HEAD_INIT, thanks to a trick found on biopython:
https://github.com/biopython/biopython/commit/d4eaf57946c7b4c32eca8d18821edf32f83e300d
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Tom Zanussi <tzanussi@gmail.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/perf/util/python.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/perf/util/python.c b/tools/perf/util/python.c index 5317ef229041..a9f2d7e1204d 100644 --- a/tools/perf/util/python.c +++ b/tools/perf/util/python.c | |||
@@ -8,6 +8,11 @@ | |||
8 | #include "cpumap.h" | 8 | #include "cpumap.h" |
9 | #include "thread_map.h" | 9 | #include "thread_map.h" |
10 | 10 | ||
11 | /* Define PyVarObject_HEAD_INIT for python 2.5 */ | ||
12 | #ifndef PyVarObject_HEAD_INIT | ||
13 | # define PyVarObject_HEAD_INIT(type, size) PyObject_HEAD_INIT(type) size, | ||
14 | #endif | ||
15 | |||
11 | struct throttle_event { | 16 | struct throttle_event { |
12 | struct perf_event_header header; | 17 | struct perf_event_header header; |
13 | u64 time; | 18 | u64 time; |