Skip to content

Commit 3918395

Browse files
author
Ralf W. Grosse-Kunstleve
committed
always include <pyconfig.h> first
[SVN r24852]
1 parent dec9c6d commit 3918395

File tree

2 files changed

+8
-11
lines changed

2 files changed

+8
-11
lines changed

include/boost/python/detail/prefix.hpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,11 @@
99
// headers (so it can get control over some awful macros).
1010
// Unfortunately, Boost.Python needs to #include <limits.h> first, at
1111
// least... but this gets us as close as possible.
12+
13+
# include <pyconfig.h>
1214
# if defined(_SGI_COMPILER_VERSION) && _SGI_COMPILER_VERSION == 741
13-
# include <complex>
15+
# undef _POSIX_C_SOURCE
16+
# undef _XOPEN_SOURCE
1417
# endif
1518
# include <boost/python/detail/wrap_python.hpp>
1619
# include <boost/python/detail/config.hpp>

include/boost/python/detail/wrap_python.hpp

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@
4040
//
4141
#include <patchlevel.h>
4242

43+
#if PY_MAJOR_VERSION<2 || PY_MAJOR_VERSION==2 && PY_MINOR_VERSION<2
44+
#error Python 2.2 or higher is required for this version of Boost.Python.
45+
#endif
46+
4347
#ifdef _DEBUG
4448
# ifndef BOOST_DEBUG_PYTHON
4549
# undef _DEBUG // Don't let Python force the debug library just because we're debugging.
@@ -96,19 +100,9 @@ typedef int pid_t;
96100
# define _MSC_VER 900
97101
# endif
98102

99-
# if PY_MAJOR_VERSION < 2 || PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION < 2
100-
# include <config.h>
101-
# else
102-
# include <pyconfig.h>
103-
# endif
104103
# undef hypot // undo the evil #define left by Python.
105104

106105
# elif defined(__BORLANDC__)
107-
# if PY_MAJOR_VERSION < 2 || PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION < 2
108-
# include <config.h>
109-
# else
110-
# include <pyconfig.h>
111-
# endif
112106
# undef HAVE_HYPOT
113107
# define HAVE_HYPOT 1
114108
# endif

0 commit comments

Comments
 (0)