Skip to content

Commit

Permalink
Make sure we always compile with BOOST_CB_ENABLE_DEBUG set to 0
Browse files Browse the repository at this point in the history
  • Loading branch information
rgacogne committed Jul 11, 2019
1 parent e1dd0d5 commit 9f6a31f
Show file tree
Hide file tree
Showing 13 changed files with 49 additions and 8 deletions.
2 changes: 2 additions & 0 deletions pdns/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ pdns_server_SOURCES = \
bindlexer.l \
bindparser.cc \
cachecleaner.hh \
circular_buffer.hh \
comment.hh \
common_startup.cc common_startup.hh \
communicator.cc communicator.hh \
Expand Down Expand Up @@ -296,6 +297,7 @@ pdnsutil_SOURCES = \
bindlexer.l \
bindparser.yy \
cachecleaner.hh \
circular_buffer.hh \
dbdnsseckeeper.cc \
dnsbackend.cc \
dns.cc \
Expand Down
34 changes: 34 additions & 0 deletions pdns/circular_buffer.hh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
* This file is part of PowerDNS or dnsdist.
* Copyright -- PowerDNS.COM B.V. and its contributors
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of version 2 of the GNU General Public License as
* published by the Free Software Foundation.
*
* In addition, for the avoidance of any doubt, permission is granted to
* link this program with OpenSSL and to (re)distribute the binaries
* produced as the result of such linking.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#pragma once

#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
#endif /* BOOST_CB_ENABLE_DEBUG */

#include <boost/circular_buffer.hpp>
2 changes: 1 addition & 1 deletion pdns/dnsdist-rings.hh
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
#include <time.h>
#include <unordered_map>

#include <boost/circular_buffer.hpp>
#include <boost/variant.hpp>

#include "circular_buffer.hh"
#include "dnsname.hh"
#include "iputils.hh"

Expand Down
2 changes: 1 addition & 1 deletion pdns/dnsdist.hh
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@
#include <unistd.h>
#include <unordered_map>

#include <boost/circular_buffer.hpp>
#include <boost/variant.hpp>

#include "bpf-filter.hh"
#include "capabilities.hh"
#include "circular_buffer.hh"
#include "dnscrypt.hh"
#include "dnsdist-cache.hh"
#include "dnsdist-dynbpf.hh"
Expand Down
3 changes: 3 additions & 0 deletions pdns/dnsdistdist/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ dnsdist_SOURCES = \
bpf-filter.cc bpf-filter.hh \
cachecleaner.hh \
capabilities.cc capabilities.hh \
circular_buffer.hh \
dns.cc dns.hh \
dnscrypt.cc dnscrypt.hh \
dnsdist.cc dnsdist.hh \
Expand Down Expand Up @@ -253,9 +254,11 @@ testrunner_SOURCES = \
test-iputils_hh.cc \
test-mplexer.cc \
cachecleaner.hh \
circular_buffer.hh \
dnsdist.hh \
dnsdist-cache.cc dnsdist-cache.hh \
dnsdist-ecs.cc dnsdist-ecs.hh \
dnsdist-rings.hh \
dnsdist-xpf.cc dnsdist-xpf.hh \
dnscrypt.cc dnscrypt.hh \
dnslabeltext.cc \
Expand Down
1 change: 1 addition & 0 deletions pdns/dnsdistdist/circular_buffer.hh
3 changes: 1 addition & 2 deletions pdns/dnsdistdist/tcpiohandler.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include <fstream>

#include "config.h"
#include "circular_buffer.hh"
#include "dolog.hh"
#include "iputils.hh"
#include "lock.hh"
Expand All @@ -17,8 +18,6 @@
#include <openssl/rand.h>
#include <openssl/ssl.h>

#include <boost/circular_buffer.hpp>

#include "libssl.hh"

/* From rfc5077 Section 4. Recommended Ticket Construction */
Expand Down
2 changes: 2 additions & 0 deletions pdns/recursordist/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ pdns_recursor_SOURCES = \
base64.cc base64.hh \
cachecleaner.hh \
capabilities.cc capabilities.hh \
circular_buffer.hh \
comment.hh \
dns.hh dns.cc \
dns_random.hh dns_random.cc \
Expand Down Expand Up @@ -218,6 +219,7 @@ testrunner_SOURCES = \
arguments.cc \
base32.cc \
base64.cc base64.hh \
circular_buffer.hh \
dns.cc dns.hh \
dns_random.cc dns_random.hh \
dnslabeltext.cc \
Expand Down
1 change: 1 addition & 0 deletions pdns/recursordist/circular_buffer.hh
2 changes: 1 addition & 1 deletion pdns/remote_logger.hh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#include <thread>

#include "iputils.hh"
#include <boost/circular_buffer.hpp>
#include "circular_buffer.hh"

/* Writes can be submitted and they are atomically accepted. Either the whole write
ends up in the buffer or nothing ends up in the buffer.
Expand Down
2 changes: 1 addition & 1 deletion pdns/statbag.hh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#include "lock.hh"
#include "namespaces.hh"
#include "iputils.hh"
#include <boost/circular_buffer.hpp>
#include "circular_buffer.hh"



Expand Down
2 changes: 1 addition & 1 deletion pdns/syncres.hh
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
#include "misc.hh"
#include "lwres.hh"
#include <boost/optional.hpp>
#include <boost/circular_buffer.hpp>
#include <boost/utility.hpp>
#include "circular_buffer.hh"
#include "sstuff.hh"
#include "recursor_cache.hh"
#include "recpacketcache.hh"
Expand Down
1 change: 0 additions & 1 deletion pdns/ws-api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
#endif

#include <boost/tokenizer.hpp>
#include <boost/circular_buffer.hpp>
#include "namespaces.hh"
#include "ws-api.hh"
#include "json.hh"
Expand Down

0 comments on commit 9f6a31f

Please sign in to comment.