Commit fdcd472b authored by Daniel Povey's avatar Daniel Povey

Fix noexcept define guard so it is not used in unsupported versions of C++.

parent 42aa2ad7
......@@ -170,7 +170,7 @@ KaldiErrorMessage::KaldiErrorMessage(const char *func, const char *file,
<< GetShortFileName(file) << ':' << line << ") ";
}
KaldiErrorMessage::~KaldiErrorMessage() NOEXCEPT(false) {
KaldiErrorMessage::~KaldiErrorMessage() KALDI_NOEXCEPT(false) {
// (1) Print the message to stderr.
std::cerr << ss.str() << '\n';
// (2) Throw an exception with the message, plus traceback info if available.
......
......@@ -27,10 +27,10 @@
#include <sstream>
#include <cstdio>
#if _MSC_VER >= 1900 || (!defined(_MSC_VER) && __cplusplus > 199711L) || defined(__GXX_EXPERIMENTAL_CXX0X__)
#define NOEXCEPT(Predicate) noexcept((Predicate))
#if _MSC_VER >= 1900 || (!defined(_MSC_VER) && __cplusplus >= 201103L) || defined(__GXX_EXPERIMENTAL_CXX0X__)
#define KALDI_NOEXCEPT(Predicate) noexcept((Predicate))
#else
#define NOEXCEPT(Predicate)
#define KALDI_NOEXCEPT(Predicate)
#endif
#include "base/kaldi-types.h"
......@@ -103,7 +103,7 @@ class KaldiErrorMessage {
public:
KaldiErrorMessage(const char *func, const char *file, int32 line);
inline std::ostream &stream() { return ss; }
~KaldiErrorMessage() NOEXCEPT(false); // defined in kaldi-error.cc
~KaldiErrorMessage() KALDI_NOEXCEPT(false); // defined in kaldi-error.cc
private:
std::ostringstream ss;
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment