I think the configure step on linux generates the pyconfig.h file which
contains 
  #define Py_DEBUG 1

On Windows, the pyconfig.h file comes from Python/PCBuild/pyconfig.h
which seems to be hand generated and contains:
#ifdef _DEBUG
#       define Py_DEBUG
#endif

I suppose the reason this was done is that configure is not used on
Windows; instead we rely on the configuration types of Visual Studio to
pick between debug and release builds.  Most users of Boost.python would
not want this set anyway which is why
boost/python/detail/wrap_python.hpp exists to suppress the automatic
definition of Py_DEBUG on windows in debug builds. 

Brian


-----Original Message-----
From: cplusplus-sig-bounces+brian.okennedy=vicon....@python.org
[mailto:cplusplus-sig-bounces+brian.okennedy=vicon....@python.org] On
Behalf Of troy d. straszheim
Sent: 22 April 2009 15:05
To: Development of Python/C++ integration
Subject: Re: [C++-sig] Extending python and using debug interpreter on
Linux

Brian O'Kennedy wrote:
> After diving deeper into boost.python and python than I felt
comfortable
> with, I found my own stupid mistake. 
> 
> On Windows, the presence of _DEBUG causes Py_DEBUG to be defined, but
> this is not the case on Linux. When I include boost/python.hpp I need
to
> define both BOOST_DEBUG_PYTHON and Py_DEBUG: Currently I'm wrapping
> includes of boost.python like so:
> 
> -------------------------------------------------------------
> #define BOOST_PYTHON_NO_LIB
> 
> #ifdef _DEBUG
>   #define BOOST_DEBUG_PYTHON
>   #ifndef WIN32 
>     #define Py_DEBUG
>   #endif
>   #pragma comment(lib, "boost_python-vc80-mt-gyd-1_38.lib" )
> #else
>   #pragma comment(lib, "boost_python-vc80-mt-1_38.lib" )
> #endif
> 
> #include <boost/python.hpp>
> -------------------------------------------------------------
> 

Hi,

Do you know how Py_DEBUG is getting set on windows?  I'm wondering where

to fix this.  Boost.build?   in boost/python.hpp itself?

-t


_______________________________________________
Cplusplus-sig mailing list
Cplusplus-sig@python.org
http://mail.python.org/mailman/listinfo/cplusplus-sig

________________________________________________________________________
This e-mail, and any attachment, is confidential. If you have received it in 
error, do not use or disclose the information in any way, notify me 
immediately, and please delete it from your system.
________________________________________________________________________
_______________________________________________
Cplusplus-sig mailing list
Cplusplus-sig@python.org
http://mail.python.org/mailman/listinfo/cplusplus-sig

Reply via email to