You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-11 13:10:58 +00:00
Bring that Whole New World to the Old Continent too
Applies the clang-format style to the 2.1 branch as done for master in
5dbf1809c6.
This commit is contained in:
@@ -28,28 +28,26 @@
|
||||
/*************************************************************************/
|
||||
#include "safe_refcount.h"
|
||||
|
||||
|
||||
#ifdef _MSC_VER
|
||||
|
||||
// don't pollute my namespace!
|
||||
#include <windows.h>
|
||||
long atomic_conditional_increment( register long * pw ) {
|
||||
long atomic_conditional_increment(register long *pw) {
|
||||
|
||||
/* try to increment until it actually works */
|
||||
// taken from boost
|
||||
|
||||
while (true) {
|
||||
long tmp = static_cast< long const volatile& >( *pw );
|
||||
if( tmp == 0 )
|
||||
return 0; // if zero, can't add to it anymore
|
||||
if( InterlockedCompareExchange( pw, tmp + 1, tmp ) == tmp )
|
||||
return tmp+1;
|
||||
long tmp = static_cast<long const volatile &>(*pw);
|
||||
if (tmp == 0)
|
||||
return 0; // if zero, can't add to it anymore
|
||||
if (InterlockedCompareExchange(pw, tmp + 1, tmp) == tmp)
|
||||
return tmp + 1;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
long atomic_decrement( register long * pw ) {
|
||||
return InterlockedDecrement( pw );
|
||||
long atomic_decrement(register long *pw) {
|
||||
return InterlockedDecrement(pw);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user