Revert "[Tizen] fixed argument for debug api (related to windows backend)"
[platform/core/uifw/dali-core.git] / dali / public-api / object / ref-object.cpp
index 57108ec..6ed98ba 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -42,7 +42,7 @@ RefObject::~RefObject()
 #ifdef ENABLE_DEBUG
   if(mCount)
   {
-    DALI_LOG_ERROR("mCount should be zero, deleting referenced object!");
+    DALI_LOG_ERROR("mCount should be zero, deleting referenced object!\n");
   }
 #endif // ENABLE_DEBUG
 }
@@ -101,8 +101,7 @@ void RefObject::Reference()
 
 #else
 
-  // gcc > 4.1 builtin atomic add and fetch:
-  __sync_add_and_fetch( &mCount, 1 );
+  std::atomic_fetch_add<int>(&mCount, 1);
 
 #endif
 }
@@ -150,8 +149,7 @@ void RefObject::Unreference()
 
 #else
 
-  // gcc > 4.1 builtin atomic subtract and fetch (--mCount; return mCount)
-  newValue = __sync_sub_and_fetch( &mCount, 1 );
+  newValue = ( mCount -= 1 );
 
 #endif