summaryrefslogtreecommitdiff
path: root/cpp/src/IceUtil/Shared.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/IceUtil/Shared.cpp')
-rw-r--r--cpp/src/IceUtil/Shared.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/cpp/src/IceUtil/Shared.cpp b/cpp/src/IceUtil/Shared.cpp
index 39805cc746e..41ae9db3549 100644
--- a/cpp/src/IceUtil/Shared.cpp
+++ b/cpp/src/IceUtil/Shared.cpp
@@ -115,7 +115,11 @@ IceUtil::Shared::__incRef()
assert(InterlockedExchangeAdd(&_ref, 0) >= 0);
InterlockedIncrement(&_ref);
#elif defined(ICE_HAS_GCC_BUILTINS)
- int c = __sync_fetch_and_add(&_ref, 1);
+
+# ifndef NDEBUG
+ int c =
+# endif
+ __sync_fetch_and_add(&_ref, 1);
assert(c >= 0);
#elif defined(ICE_HAS_ATOMIC_FUNCTIONS)
assert(IceUtilInternal::atomicExchangeAdd(&_ref, 0) >= 0);