This is an automated email from the ASF dual-hosted git repository.

jensg pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/thrift.git


The following commit(s) were added to refs/heads/master by this push:
     new 7391a31  uncaught_exception -> uncaught_exceptions Client: cpp Author: 
Rune Olesen
7391a31 is described below

commit 7391a3103224a02519d0f976874163bf90531456
Author: Jens Geyer <[email protected]>
AuthorDate: Wed Jun 30 22:22:37 2021 +0200

    uncaught_exception -> uncaught_exceptions
    Client: cpp
    Author: Rune Olesen
    
    This closes #2287
---
 lib/cpp/src/thrift/transport/TFDTransport.cpp | 4 ++++
 1 file changed, 4 insertions(+)

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 @@ 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);
   }
 }

Reply via email to