Quantcast

quick question about macro

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

quick question about macro

Boost - Users mailing list
hi there!

I'm using boost library occasionally and have this simpleton question to ask.
i need to debug boost::asio::io_service by enabling BOOST_ASIO_ENABLE_HANDLER_TRACKING macro.

so, do I have to rebuild the library like 

   ./b2 cxxflags="-DBOOST_ASIO_ENABLE_HANDLER_TRACKING"...

or adding 

  #define BOOST_ASIO_ENABLE_HANDLER_TRACKING

to my source file is enough? (this doesn't work for me, so i suspect I should go with the first option)

thanks,

--
Peter Gusev


_______________________________________________
Boost-users mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: quick question about macro

Boost - Users mailing list
On 23/02/2017 19:29, Peter Gusev via Boost-users wrote:

> I'm using boost library occasionally and have this simpleton question to
> ask.
> i need to debug *boost::asio::io_service* by
> enabling *BOOST_ASIO_ENABLE_HANDLER_TRACKING* macro.
>
> so, do I have to rebuild the library like
>
> /*   ./b2 cxxflags="-DBOOST_ASIO_ENABLE_HANDLER_TRACKING"...*/
>
> or adding
>
> /*  #define BOOST_ASIO_ENABLE_HANDLER_TRACKING*/
>
> to my source file is enough? (this doesn't work for me, so i suspect I
> should go with the first option)

Asio is a header-based library, so doing anything with b2 isn't going to
accomplish anything.

You need to add the #define ahead of any inclusion of the Asio headers
in any source file that uses them.  The simplest option is generally to
put it in your project file (or whatever you're using to build your
application).


_______________________________________________
Boost-users mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/boost-users
Loading...