Boost logo

Boost :

From: Peter Hornby (peterho_at_[hidden])
Date: 2004-03-08 04:34:08


Sorry if this has been mentioned before. the following patch against
boost-1.31.0 silences the warnings on linux, but I have not tested that
there are no side-effects on other compilers.

--------------------------------START PATCH------------------------

Index: boost/python/detail/wrap_python.hpp
===================================================================
RCS file: /cvsroot/boost/boost/boost/python/detail/wrap_python.hpp,v
retrieving revision 1.17
diff -p -r1.17 wrap_python.hpp
*** boost/python/detail/wrap_python.hpp 1 May 2003 05:19:47 -0000 1.17
--- boost/python/detail/wrap_python.hpp 1 Mar 2004 05:36:49 -0000
***************
*** 23,28 ****
--- 23,29 ----
   //
   // Python's LongObject.h helpfully #defines ULONGLONG_MAX for us,
   // which confuses Boost's config
+ // Also kill any definition of _POSIX_C_SOURCE so Python.h can
determine it.
   //
   #include <limits.h>
   #ifndef ULONG_MAX
***************
*** 34,39 ****
--- 35,44 ----
   #ifndef ULONGLONG_MAX
   # define BOOST_PYTHON_ULONGLONG_MAX_UNDEFINED
   #endif
+ #ifdef _POSIX_C_SOURCE
+ # undef _POSIX_C_SOURCE
+ #endif
+

   //
   // Get ahold of Python's version number
--------------------------------END PATCH------------------------

Index: boost/python/detail/wrap_python.hpp
===================================================================
RCS file: /cvsroot/boost/boost/boost/python/detail/wrap_python.hpp,v
retrieving revision 1.17
diff -p -r1.17 wrap_python.hpp
*** boost/python/detail/wrap_python.hpp 1 May 2003 05:19:47 -0000 1.17
--- boost/python/detail/wrap_python.hpp 1 Mar 2004 05:36:49 -0000
***************
*** 23,28 ****
--- 23,29 ----
  //
  // Python's LongObject.h helpfully #defines ULONGLONG_MAX for us,
  // which confuses Boost's config
+ // Also kill any definition of _POSIX_C_SOURCE so Python.h can determine it.
  //
  #include <limits.h>
  #ifndef ULONG_MAX
***************
*** 34,39 ****
--- 35,44 ----
  #ifndef ULONGLONG_MAX
  # define BOOST_PYTHON_ULONGLONG_MAX_UNDEFINED
  #endif
+ #ifdef _POSIX_C_SOURCE
+ # undef _POSIX_C_SOURCE
+ #endif
+
  
  //
  // Get ahold of Python's version number


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk