Skip to content

Commit

Permalink
BOOST_CB_ENABLE_DEBUG is overridden before 1.62, set BOOST_CB_DISABLE…
Browse files Browse the repository at this point in the history
…_DEBUG instead
  • Loading branch information
rgacogne committed Jul 12, 2019
1 parent 9f6a31f commit 7fa225c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pdns/circular_buffer.hh
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,18 @@
*/
#pragma once

// Disable the non-threadsafe debug code in boost::circular_buffer before 1.62
#define BOOST_CB_DISABLE_DEBUG 1

// Make sure it is also disabled when >= 1.62
#ifndef BOOST_CB_ENABLE_DEBUG
#define BOOST_CB_ENABLE_DEBUG 0
#endif

#if BOOST_CB_ENABLE_DEBUG
// https://github.com/boostorg/circular_buffer/pull/9
// https://svn.boost.org/trac10/ticket/6277
#error Building with BOOST_CB_ENABLE_DEBUG prevents accessing a boost::circular_buffer from two threads at once
#error Building with BOOST_CB_ENABLE_DEBUG prevents accessing a boost::circular_buffer from more than one thread at once
#endif /* BOOST_CB_ENABLE_DEBUG */

#include <boost/circular_buffer.hpp>

0 comments on commit 7fa225c

Please sign in to comment.