Fix build failures with python support on sparc-solaris
authorJoel Brobecker <brobecker@gnat.com>
Tue, 26 Oct 2010 18:06:34 +0000 (18:06 +0000)
committerJoel Brobecker <brobecker@gnat.com>
Tue, 26 Oct 2010 18:06:34 +0000 (18:06 +0000)
There were two types of errors, mostly compiler warnings:

  1. _FILE_OFFSET_BITS being redefined in pyconfig.h;
     This is a problem we're familiar with, having seen similar
     issues on GNU/Linux systems. I used a similar solution.

  2. GCC 4.5 complains that calls to PyEval_InitThreads and
     PyEval_ReleaseLock have no effect.  This is because our Python
     is built without thread support, leading us to use the dummy
     #define in python-internal.h which just gets replaced by `0'.
     Since this function returns void (checked versions 2.4 and 2.7),
     I simply removed the 0.

gdb/ChangeLog:

        python/python-internal.h (_FILE_OFFSET_BITS): Undefine.
        (PyEval_InitThreads): Remove duplicate. Define as nothing.
        (PyEval_ReleaseLock): Define as nothing.

gdb/ChangeLog
gdb/python/python-internal.h

index ad3e89476484cc69aa51d9b2ec68fa03f2db161e..4bfe01708e43ea9b5771eea0f45d5b2ea4355fc6 100644 (file)
@@ -1,3 +1,9 @@
+2010-10-26  Joel Brobecker  <brobecker@adacore.com>
+
+       * python/python-internal.h (_FILE_OFFSET_BITS): Undefine.
+       (PyEval_InitThreads): Remove duplicate. Define as nothing.
+       (PyEval_ReleaseLock): Define as nothing.
+
 2010-10-26  Joel Brobecker  <brobecker@adacore.com>
 
        * dwarf2read.c (psymtab_include_file_name): Replace call to strcmp
index d00c23e313e86e696a0722c08569696ee23daeb9..e18f50ad4bb7370f2499b9bbf5169da0c356e932 100644 (file)
 #undef _POSIX_C_SOURCE
 #undef _XOPEN_SOURCE
 
+/* On sparc-solaris, /usr/include/sys/feature_tests.h defines
+   _FILE_OFFSET_BITS, which pyconfig.h also defines.  Same work
+   arount technique as above.  */
+#undef _FILE_OFFSET_BITS
+
 #if HAVE_LIBPYTHON2_4
 #include "python2.4/Python.h"
 #include "python2.4/frameobject.h"
@@ -63,10 +68,9 @@ typedef int Py_ssize_t;
 #ifndef WITH_THREAD
 #define PyGILState_Ensure() ((PyGILState_STATE) 0)
 #define PyGILState_Release(ARG) ((void)(ARG))
-#define PyEval_InitThreads() 0
+#define PyEval_InitThreads()
 #define PyThreadState_Swap(ARG) ((void)(ARG))
-#define PyEval_InitThreads() 0
-#define PyEval_ReleaseLock() 0
+#define PyEval_ReleaseLock()
 #endif
 
 /* In order to be able to parse symtab_and_line_to_sal_object function 
This page took 0.053039 seconds and 4 git commands to generate.