[RFA] Fix cygwin compilation failure for python code

Pierre Muller
2010-03-08T16:38:03Z

Using Cygwin, I got several compilation failures
related to the incomplete struct symtab_and_line
used as parameter in function
symtab_and_line_to_sal_object.

The patch below allows for me to
read in "symtab.h" before "python-internal.h" is read,
and thus get a real definition of the symtab_and_line struct.

I wonder why I am the only one having this
problem?

Is this patch OK? Otherwise,
how should such problems be handled?

Pierre Muller

2010-03-08 Pierre Muller <muller@ics.u-strasbg.fr>

* py-lazy-string.c: Move "python-internal.h"
inlcusion to allow compilation.
* py-objfile.c: Idem.
* py-utils.c: Add "symtab.h" header to allow compilation.

Index: py-lazy-string.c
===================================================================
RCS file: /cvs/src/src/gdb/python/py-lazy-string.c,v
retrieving revision 1.2
diff -u -p -r1.2 py-lazy-string.c
--- py-lazy-string.c 5 Mar 2010 19:28:13 -0000 1.2
+++ py-lazy-string.c 8 Mar 2010 16:30:13 -0000
@@ -18,12 +18,12 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#include "defs.h"
-#include "python-internal.h"
#include "charset.h"
#include "value.h"
#include "exceptions.h"
#include "valprint.h"
#include "language.h"
+#include "python-internal.h"

typedef struct {
PyObject_HEAD
Index: py-objfile.c
===================================================================
RCS file: /cvs/src/src/gdb/python/py-objfile.c,v
retrieving revision 1.3
diff -u -p -r1.3 py-objfile.c
--- py-objfile.c 1 Jan 2010 07:31:50 -0000 1.3
+++ py-objfile.c 8 Mar 2010 16:30:13 -0000
@@ -18,10 +18,10 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#include "defs.h"
-#include "python-internal.h"
#include "charset.h"
#include "objfiles.h"
#include "language.h"
+#include "python-internal.h"

typedef struct
{
Index: py-utils.c
===================================================================
RCS file: /cvs/src/src/gdb/python/py-utils.c,v
retrieving revision 1.3
diff -u -p -r1.3 py-utils.c
--- py-utils.c 5 Mar 2010 20:18:17 -0000 1.3
+++ py-utils.c 8 Mar 2010 16:30:13 -0000
@@ -19,6 +19,7 @@

#include "defs.h"
#include "charset.h"
+#include "symtab.h"
#include "python-internal.h"