BIND 10 trac837, updated. 00ea61bf4e0941bc02664723e89fbb39dc568bbe [trac837] Protect static constant member redeclare by !_MSC_VER (should be by <only buggy compilers> :-)
BIND 10 source code commits
bind10-changes at lists.isc.org
Wed Apr 6 14:51:28 UTC 2011
The branch, trac837 has been updated
via 00ea61bf4e0941bc02664723e89fbb39dc568bbe (commit)
via fb1d9279399ffd519577b0d32e74bade575ed997 (commit)
via e8b069dc74825fdcce4aeb126399e01567c30d8d (commit)
from e7d0dbd6ba745bab334aef6e747056c33f5edaa8 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 00ea61bf4e0941bc02664723e89fbb39dc568bbe
Author: Francis Dupont <fdupont at isc.org>
Date: Wed Apr 6 16:50:10 2011 +0200
[trac837] Protect static constant member redeclare by !_MSC_VER
(should be by <only buggy compilers> :-)
commit fb1d9279399ffd519577b0d32e74bade575ed997
Author: Francis Dupont <fdupont at isc.org>
Date: Wed Apr 6 16:48:17 2011 +0200
[trac837] Initialize static constant members in *.cc files
commit e8b069dc74825fdcce4aeb126399e01567c30d8d
Author: Francis Dupont <fdupont at isc.org>
Date: Wed Apr 6 16:46:31 2011 +0200
[trac837] remove initializations of static constant members from includes
-----------------------------------------------------------------------
Summary of changes:
src/lib/dns/edns.cc | 2 ++
src/lib/dns/edns.h | 2 +-
src/lib/dns/message.cc | 3 +++
src/lib/dns/message.h | 4 ++--
src/lib/dns/name.cc | 7 +++++++
src/lib/dns/name.h | 12 ++++++------
src/lib/dns/tests/edns_unittest.cc | 2 ++
src/lib/dns/tests/message_unittest.cc | 2 ++
src/lib/dns/tests/name_unittest.cc | 2 ++
9 files changed, 27 insertions(+), 9 deletions(-)
-----------------------------------------------------------------------
diff --git a/src/lib/dns/edns.cc b/src/lib/dns/edns.cc
index 6e25624..5eeaa8f 100644
--- a/src/lib/dns/edns.cc
+++ b/src/lib/dns/edns.cc
@@ -40,6 +40,8 @@ using namespace isc::dns::rdata;
namespace isc {
namespace dns {
+const uint8_t EDNS::SUPPORTED_VERSION = 0;
+
namespace {
// This diagram shows the wire-format representation of the TTL field of
// OPT RR and its relationship with implementation specific parameters.
diff --git a/src/lib/dns/edns.h b/src/lib/dns/edns.h
index ca3db47..8da6651 100644
--- a/src/lib/dns/edns.h
+++ b/src/lib/dns/edns.h
@@ -358,7 +358,7 @@ private:
public:
/// \brief The highest EDNS version this implementation supports.
- static const uint8_t SUPPORTED_VERSION = 0;
+ static const uint8_t SUPPORTED_VERSION;
private:
// We may eventually want to migrate to pimpl, especially when we support
// EDNS options. In this initial implementation, we keep it simple.
diff --git a/src/lib/dns/message.cc b/src/lib/dns/message.cc
index 9eae605..730798c 100644
--- a/src/lib/dns/message.cc
+++ b/src/lib/dns/message.cc
@@ -47,6 +47,9 @@ using namespace isc::dns::rdata;
namespace isc {
namespace dns {
+const uint16_t Message::DEFAULT_MAX_UDPSIZE = 512;
+const uint16_t Message::DEFAULT_MAX_EDNS0_UDPSIZE = 4096;
+
namespace {
// protocol constants
const size_t HEADERLEN = 12;
diff --git a/src/lib/dns/message.h b/src/lib/dns/message.h
index 0bbb9ea..f355a31 100644
--- a/src/lib/dns/message.h
+++ b/src/lib/dns/message.h
@@ -542,10 +542,10 @@ public:
/// truncation.
///
/// With EDNS the maximum size can be increased per message.
- static const uint16_t DEFAULT_MAX_UDPSIZE = 512;
+ static const uint16_t DEFAULT_MAX_UDPSIZE;
/// \brief The default maximum size of UDP DNS messages we can handle
- static const uint16_t DEFAULT_MAX_EDNS0_UDPSIZE = 4096;
+ static const uint16_t DEFAULT_MAX_EDNS0_UDPSIZE;
//@}
private:
diff --git a/src/lib/dns/name.cc b/src/lib/dns/name.cc
index 8786bcf..eef9ff7 100644
--- a/src/lib/dns/name.cc
+++ b/src/lib/dns/name.cc
@@ -32,6 +32,13 @@ using isc::dns::MessageRenderer;
namespace isc {
namespace dns {
+const size_t Name:: MAX_WIRE = 255;
+const size_t Name:: MAX_LABELS = 128;
+const size_t Name:: MAX_LABELLEN = 63;
+const uint16_t Name:: MAX_COMPRESS_POINTER = 0x3fff;
+const uint16_t Name:: COMPRESS_POINTER_MARK8 = 0xc0;
+const uint16_t Name:: COMPRESS_POINTER_MARK16 = 0xc000;
+
namespace {
///
/// These are shortcut arrays for efficient character conversion.
diff --git a/src/lib/dns/name.h b/src/lib/dns/name.h
index dc1b5b3..969be58 100644
--- a/src/lib/dns/name.h
+++ b/src/lib/dns/name.h
@@ -629,27 +629,27 @@ public:
///
//@{
/// \brief Max allowable length of domain names.
- static const size_t MAX_WIRE = 255;
+ static const size_t MAX_WIRE;
/// \brief Max allowable labels of domain names.
///
/// This is <code>ceil(MAX_WIRE / 2)</code>, and is equal to the number of
/// labels of name "a.a.a.a....a." (127 "a"'s and trailing dot).
- static const size_t MAX_LABELS = 128;
+ static const size_t MAX_LABELS;
/// \brief Max allowable length of labels of a domain name.
- static const size_t MAX_LABELLEN = 63;
+ static const size_t MAX_LABELLEN;
/// \brief Max possible pointer value for name compression.
///
/// This is the highest number of 14-bit unsigned integer. Name compression
/// pointers are identified as a 2-byte value starting with the upper two
/// bit being 11.
- static const uint16_t MAX_COMPRESS_POINTER = 0x3fff;
+ static const uint16_t MAX_COMPRESS_POINTER;
/// \brief A 8-bit masked value indicating a start of compression pointer.
- static const uint16_t COMPRESS_POINTER_MARK8 = 0xc0;
+ static const uint16_t COMPRESS_POINTER_MARK8;
/// \brief A 16-bit masked value indicating a start of compression pointer.
- static const uint16_t COMPRESS_POINTER_MARK16 = 0xc000;
+ static const uint16_t COMPRESS_POINTER_MARK16;
//@}
///
diff --git a/src/lib/dns/tests/edns_unittest.cc b/src/lib/dns/tests/edns_unittest.cc
index fb9a7c2..ef8b182 100644
--- a/src/lib/dns/tests/edns_unittest.cc
+++ b/src/lib/dns/tests/edns_unittest.cc
@@ -37,7 +37,9 @@ using namespace std;
using namespace isc::dns;
using namespace isc::dns::rdata;
+#ifndef _MSC_VER
const uint8_t EDNS::SUPPORTED_VERSION;
+#endif
namespace {
class EDNSTest : public ::testing::Test {
diff --git a/src/lib/dns/tests/message_unittest.cc b/src/lib/dns/tests/message_unittest.cc
index 92adbc9..a0dae8b 100644
--- a/src/lib/dns/tests/message_unittest.cc
+++ b/src/lib/dns/tests/message_unittest.cc
@@ -49,7 +49,9 @@ using namespace isc::dns::rdata;
// class, at which point we'll also revise the tests including more cases.
//
+#ifndef _MSC_VER
const uint16_t Message::DEFAULT_MAX_UDPSIZE;
+#endif
const Name test_name("test.example.com");
namespace {
diff --git a/src/lib/dns/tests/name_unittest.cc b/src/lib/dns/tests/name_unittest.cc
index 5daba9c..780dd90 100644
--- a/src/lib/dns/tests/name_unittest.cc
+++ b/src/lib/dns/tests/name_unittest.cc
@@ -36,8 +36,10 @@ using namespace isc::dns;
// XXX: these are defined as class static constants, but some compilers
// seemingly cannot find the symbols when used in the EXPECT_xxx macros.
//
+#ifndef _MSC_VER
const size_t Name::MAX_WIRE;
const size_t Name::MAX_LABELS;
+#endif
namespace {
class NameTest : public ::testing::Test {
More information about the bind10-changes
mailing list