/*
- * 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.
#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
}
#else
- // gcc > 4.1 builtin atomic add and fetch:
- __sync_add_and_fetch( &mCount, 1 );
+ std::atomic_fetch_add<int>(&mCount, 1);
#endif
}
#else
- // gcc > 4.1 builtin atomic subtract and fetch (--mCount; return mCount)
- newValue = __sync_sub_and_fetch( &mCount, 1 );
+ newValue = ( mCount -= 1 );
#endif