Skip to content

Commit 9e844d7

Browse files
committed
__sync* are GCC/Clang atomic builtins supported on any platform
In file included from Source/GmmLib/Platform/GmmGen11Platform.cpp:23: In file included from Source/GmmLib/inc/Internal/Common/GmmLibInc.h:35: In file included from Source/GmmLib/inc/External/Common/GmmCachePolicy.h:332: Source/GmmLib/inc/External/Common/GmmCachePolicyCommon.h:74:13: error: control reaches end of non-void function [-Werror,-Wreturn-type] } ^ Source/GmmLib/GlobalInfo/GmmInfo.cpp:600:1: error: non-void function does not return a value in all control paths [-Werror,-Wreturn-type] } ^ Source/GmmLib/GlobalInfo/GmmInfo.cpp:635:5: error: expected 'while' in do/while loop else ^ Source/GmmLib/GlobalInfo/GmmInfo.cpp:616:9: note: to match this 'do' do ^ Source/GmmLib/GlobalInfo/GmmInfo.cpp:803:18: error: qualified reference to 'Context' is a constructor name rather than a type in this context GmmLib::Context::Context() ^ Source/GmmLib/GlobalInfo/GmmInfo.cpp:804:5: error: expected ';' after expression : ClientType(), ^ [...]
1 parent 2cadaa5 commit 9e844d7

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Source/GmmLib/GlobalInfo/GmmInfo.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -756,7 +756,7 @@ int32_t GMM_STDCALL GmmLib::GmmMultiAdapterContext::IncrementRefCount(ADAPTER_BD
756756
{
757757
int32_t *Ref = &pNode->RefCount;
758758

759-
#if defined(__linux__)
759+
#if defined(__GNUC__)
760760
// returns 0 only when registering the first client
761761
return (__sync_fetch_and_add(Ref, 1));
762762
#endif
@@ -802,7 +802,7 @@ int32_t GMM_STDCALL GmmLib::GmmMultiAdapterContext::DecrementRefCount(ADAPTER_BD
802802
}
803803
#if defined(_WIN32)
804804
} while(!(InterlockedCompareExchange((LONG *)Ref, TargetValue, CurrentValue) == CurrentValue));
805-
#elif defined(__linux__)
805+
#elif defined(__GNUC__)
806806
} while(!__sync_bool_compare_and_swap(Ref, CurrentValue, TargetValue));
807807
#endif
808808

Source/GmmLib/inc/External/Common/GmmInfo.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ namespace GmmLib
128128
{
129129
#if defined(_WIN32)
130130
return(InterlockedIncrement((LONG *)&RefCount) - 1); //InterLockedIncrement() returns incremented value
131-
#elif defined(__linux__)
131+
#elif defined(__GNUC__)
132132
return(__sync_fetch_and_add(&RefCount, 1));
133133
#endif
134134
}
@@ -150,7 +150,7 @@ namespace GmmLib
150150
}
151151
#if defined(_WIN32)
152152
} while (!(InterlockedCompareExchange((LONG *)&RefCount, TargetValue, CurrentValue) == CurrentValue));
153-
#elif defined(__linux__)
153+
#elif defined(__GNUC__)
154154
} while (!__sync_bool_compare_and_swap(&RefCount, CurrentValue, TargetValue));
155155
#endif
156156

0 commit comments

Comments
 (0)