uncaught_exception -> uncaught_exceptions
Client: cpp
Author: Rune Olesen
This closes #2287
diff --git a/lib/cpp/src/thrift/transport/TFDTransport.cpp b/lib/cpp/src/thrift/transport/TFDTransport.cpp
index fa7f0da..0cadcb5 100644
--- a/lib/cpp/src/thrift/transport/TFDTransport.cpp
+++ b/lib/cpp/src/thrift/transport/TFDTransport.cpp
@@ -46,7 +46,11 @@
int errno_copy = THRIFT_ERRNO;
fd_ = -1;
// Have to check uncaught_exception because this is called in the destructor.
+#ifdef __cpp_lib_uncaught_exceptions
+ if (rv < 0 && !std::uncaught_exceptions()) {
+#else
if (rv < 0 && !std::uncaught_exception()) {
+#endif
throw TTransportException(TTransportException::UNKNOWN, "TFDTransport::close()", errno_copy);
}
}