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

bbender pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode-native.git


The following commit(s) were added to refs/heads/develop by this push:
     new 2dd6f6d  GEODE-8973: Fix calls dup on exception handling (#763)
2dd6f6d is described below

commit 2dd6f6d8a4e9a67f310eebcacd9f2fdca55047b2
Author: Mario Salazar de Torres <[email protected]>
AuthorDate: Mon Mar 15 21:23:11 2021 +0100

    GEODE-8973: Fix calls dup on exception handling (#763)
    
    - Whenever calling throwExceptionIfError macro it can happen that calls
       are duplicated. Hence the macro has been replaced by a inlined
       function.
---
 cppcache/src/util/exception.hpp | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/cppcache/src/util/exception.hpp b/cppcache/src/util/exception.hpp
index c1aac50..a839531 100644
--- a/cppcache/src/util/exception.hpp
+++ b/cppcache/src/util/exception.hpp
@@ -32,12 +32,11 @@ namespace client {
 
 extern void GfErrTypeThrowException(const char* str, GfErrType err);
 
-#define throwExceptionIfError(str, err)  \
-  do {                                   \
-    if (err != GF_NOERR) {               \
-      GfErrTypeThrowException(str, err); \
-    }                                    \
-  } while (0)
+inline void throwExceptionIfError(const char* str, GfErrType err) {
+  if (err != GF_NOERR) {
+    GfErrTypeThrowException(str, err);
+  }
+}
 
 }  // namespace client
 }  // namespace geode

Reply via email to