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, ...@@ -170,7 +170,7 @@ KaldiErrorMessage::KaldiErrorMessage(const char *func, const char *file,
<< GetShortFileName(file) << ':' << line << ") "; << GetShortFileName(file) << ':' << line << ") ";
} }
KaldiErrorMessage::~KaldiErrorMessage() NOEXCEPT(false) { KaldiErrorMessage::~KaldiErrorMessage() KALDI_NOEXCEPT(false) {
// (1) Print the message to stderr. // (1) Print the message to stderr.
std::cerr << ss.str() << '\n'; std::cerr << ss.str() << '\n';
// (2) Throw an exception with the message, plus traceback info if available. // (2) Throw an exception with the message, plus traceback info if available.
......
...@@ -27,10 +27,10 @@ ...@@ -27,10 +27,10 @@
#include <sstream> #include <sstream>
#include <cstdio> #include <cstdio>
#if _MSC_VER >= 1900 || (!defined(_MSC_VER) && __cplusplus > 199711L) || defined(__GXX_EXPERIMENTAL_CXX0X__) #if _MSC_VER >= 1900 || (!defined(_MSC_VER) && __cplusplus >= 201103L) || defined(__GXX_EXPERIMENTAL_CXX0X__)
#define NOEXCEPT(Predicate) noexcept((Predicate)) #define KALDI_NOEXCEPT(Predicate) noexcept((Predicate))
#else #else
#define NOEXCEPT(Predicate) #define KALDI_NOEXCEPT(Predicate)
#endif #endif
#include "base/kaldi-types.h" #include "base/kaldi-types.h"
...@@ -103,7 +103,7 @@ class KaldiErrorMessage { ...@@ -103,7 +103,7 @@ class KaldiErrorMessage {
public: public:
KaldiErrorMessage(const char *func, const char *file, int32 line); KaldiErrorMessage(const char *func, const char *file, int32 line);
inline std::ostream &stream() { return ss; } inline std::ostream &stream() { return ss; }
~KaldiErrorMessage() NOEXCEPT(false); // defined in kaldi-error.cc ~KaldiErrorMessage() KALDI_NOEXCEPT(false); // defined in kaldi-error.cc
private: private:
std::ostringstream ss; 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