diff options
author | Jelte Jansen <jelte@isc.org> | 2013-03-13 16:53:53 +0100 |
---|---|---|
committer | Jelte Jansen <jelte@isc.org> | 2013-03-13 16:53:53 +0100 |
commit | b47eafefecf38d32013bc7377aa4eebf531c49f6 (patch) | |
tree | 2c7d4e8f3d8f00b9a30d5668db0b93588b816b49 | |
parent | [master] Fix test: remove sleep, use fake mtime (diff) | |
download | kea-b47eafefecf38d32013bc7377aa4eebf531c49f6.tar.xz kea-b47eafefecf38d32013bc7377aa4eebf531c49f6.zip |
[master] fix clang issue with exception in unnamed namespace
-rw-r--r-- | src/lib/util/encode/base_n.cc | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/src/lib/util/encode/base_n.cc b/src/lib/util/encode/base_n.cc index f5f930af4f..8c813c39c3 100644 --- a/src/lib/util/encode/base_n.cc +++ b/src/lib/util/encode/base_n.cc @@ -40,6 +40,15 @@ namespace isc { namespace util { namespace encode { +// Some versions of clang cannot handle exceptions in unnamed namespaces +// so this exception is defined in an 'internal' namespace +namespace clang_unnamed_namespace_workaround { +// An internally caught exception to unify a few possible cases of the same +// error. +class IncompleteBaseInput : public std::exception { +}; +} // end namespace internal + // In the following anonymous namespace, we provide a generic framework // to encode/decode baseN format. We use the following tools: // - boost base64_from_binary/binary_from_base64: provide mapping table for @@ -144,11 +153,6 @@ private: bool in_pad_; }; -// An internally caught exception to unify a few possible cases of the same -// error. -class IncompleteBaseInput : public std::exception { -}; - // DecodeNormalizer is an input iterator intended to be used as a filter // between the encoded baseX stream and binary_from_baseXX. // A DecodeNormalizer object is configured with three string iterators @@ -217,7 +221,9 @@ public: // but in that case we need to catch incomplete baseX input in // a different way. It's done via char_count_ and after the // completion of decoding. - throw IncompleteBaseInput(); // throw this now and convert it + + // throw this now and convert it + throw clang_unnamed_namespace_workaround::IncompleteBaseInput(); } if (*base_ == BASE_PADDING_CHAR) { // Padding can only happen at the end of the input string. We can @@ -378,9 +384,10 @@ BaseNTransformer<BitsPerChunk, BaseZeroCode, Encoder, Decoder>::decode( // a multiple of 8; otherwise the decoder reaches the end of input // with some incomplete bits of data, which is invalid. if (((char_count * BitsPerChunk) % 8) != 0) { - throw IncompleteBaseInput(); // catch this immediately below + // catch this immediately below + throw clang_unnamed_namespace_workaround::IncompleteBaseInput(); } - } catch (const IncompleteBaseInput&) { + } catch (const clang_unnamed_namespace_workaround::IncompleteBaseInput&) { // we unify error handling for incomplete input here. isc_throw(BadValue, "Incomplete input for " << algorithm << ": " << input); |