Pycxx Debugmacro

In CXX/Python3/ExtentionType.hxx we have several blocks of the form:

            std::cout << "extension_object_new()" << std::endl;

This is rather ugly, and can be tidied up by the following:

// wherever PYCXX_DEBUG is defined: for me, this is in CXX/WrapPython.h
#define PYCXX_DEBUG (1)

#   define IF_PYCXX_DEBUG( x ) x
#   define IF_PYCXX_DEBUG( x )

And then we can just write:

            IF_PYCXX_DEBUG( std::cout << "extension_object_new()" << std::endl; )

This is more succinct, reads better, and upholds indentation.

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License