This is the mail archive of the
archer@sourceware.org
mailing list for the Archer project.
[python] build fix for python 2.4
- From: Tom Tromey <tromey at redhat dot com>
- To: Project Archer <archer at sourceware dot org>
- Date: Wed, 07 Jan 2009 15:06:36 -0700
- Subject: [python] build fix for python 2.4
- Reply-to: Tom Tromey <tromey at redhat dot com>
I needed this to be able to build the python branch using python 2.4.
Python's API changed incompatibly here -- they removed a `const' that
was there in 2.4. This patch hacks around it with a cast.
I needed this patch and the previous one to get a baseline for the
master->python merge. I'll check that in once the regression testing
is done.
Tom
2009-01-07 Tom Tromey <tromey@redhat.com>
* python/python-membuf.c (buffer_procs): Add compatibility cast.
diff --git a/gdb/python/python-membuf.c b/gdb/python/python-membuf.c
index f4a500f..1b57da7 100644
--- a/gdb/python/python-membuf.c
+++ b/gdb/python/python-membuf.c
@@ -1,6 +1,6 @@
/* Python interface to the inferior memory.
- Copyright (C) 2008 Free Software Foundation, Inc.
+ Copyright (C) 2008, 2009 Free Software Foundation, Inc.
This file is part of GDB.
@@ -172,7 +172,9 @@ static PyBufferProcs buffer_procs = {
get_read_buffer,
get_write_buffer,
get_seg_count,
- get_char_buffer
+ /* The cast here works around a difference between Python 2.4 and
+ Python 2.5. */
+ (getcharbufferproc) get_char_buffer
};
static PyTypeObject membuf_object_type = {