summaryrefslogtreecommitdiff
path: root/lib/cpp
diff options
context:
space:
mode:
authorJens Geyer <jensg@apache.org>2021-06-30 22:22:37 +0200
committerJens Geyer <jensg@apache.org>2021-06-30 22:22:37 +0200
commit7391a3103224a02519d0f976874163bf90531456 (patch)
treed7c284d546fa49627d0331945aab7dfa48b863f6 /lib/cpp
parent582293bb5ee268fc64ecefe710a5bcf253df1a6e (diff)
downloadthrift-7391a3103224a02519d0f976874163bf90531456.tar.gz
uncaught_exception -> uncaught_exceptions
Client: cpp Author: Rune Olesen This closes #2287
Diffstat (limited to 'lib/cpp')
-rw-r--r--lib/cpp/src/thrift/transport/TFDTransport.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/cpp/src/thrift/transport/TFDTransport.cpp b/lib/cpp/src/thrift/transport/TFDTransport.cpp
index fa7f0dabe..0cadcb553 100644
--- a/lib/cpp/src/thrift/transport/TFDTransport.cpp
+++ b/lib/cpp/src/thrift/transport/TFDTransport.cpp
@@ -46,7 +46,11 @@ void TFDTransport::close() {
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);
}
}