Skip to content

Commit a348e40

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] } ^ In file included from Source/GmmLib/Platform/GmmGen11Platform.cpp:23: In file included from Source/GmmLib/inc/Internal/Common/GmmLibInc.h:38: Source/GmmLib/inc/../Platform/GmmPlatforms.h:86:9: error: control reaches end of non-void function [-Werror,-Wreturn-type] } ^ In file included from Source/GmmLib/Platform/GmmGen11Platform.cpp:23: In file included from Source/GmmLib/inc/Internal/Common/GmmLibInc.h:42: In file included from Source/GmmLib/inc/../Texture/GmmTexture.h:27: In file included from Source/GmmLib/inc/External/Common/GmmInfoExt.h:25: Source/GmmLib/inc/External/Common/GmmInfo.h:134:9: error: control reaches end of non-void function [-Werror,-Wreturn-type] } ^ In file included from Source/GmmLib/CachePolicy/GmmGen11CachePolicy.cpp:23: In file included from Source/GmmLib/inc/Internal/Common/GmmLibInc.h:42: In file included from Source/GmmLib/inc/../Texture/GmmTexture.h:31: Source/GmmLib/inc/Internal/Common/Texture/GmmTextureCalc.h:163:13: error: control reaches end of non-void function [-Werror,-Wreturn-type] } ^
1 parent abd1dfc commit a348e40

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

Source/GmmLib/Platform/GmmPlatforms.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ namespace GmmLib {
8686
{
8787
#if defined(__GMM_KMD__) || _WIN32
8888
InterlockedIncrement((LONG *)&RefCount);
89-
#elif defined(__linux__)
89+
#elif defined(__GNUC__)
9090
__sync_fetch_and_add(&RefCount, 1);
9191
#endif
9292
//TODO[Android]
@@ -96,7 +96,7 @@ namespace GmmLib {
9696
{
9797
#if defined(__GMM_KMD__) || _WIN32
9898
return(InterlockedDecrement((LONG *)&RefCount));
99-
#elif defined(__linux__)
99+
#elif defined(__GNUC__)
100100
return(__sync_sub_and_fetch(&RefCount, 1));
101101
#endif
102102
//TODO[Android]

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ namespace GmmLib
5858
{
5959
#if defined(__GMM_KMD__) || _WIN32
6060
InterlockedIncrement((LONG *)&RefCount);
61-
#elif defined(__linux__)
61+
#elif defined(__GNUC__)
6262
__sync_fetch_and_add(&RefCount, 1);
6363
#endif
6464
//TODO[Android]
@@ -68,7 +68,7 @@ namespace GmmLib
6868
{
6969
#if defined(__GMM_KMD__) || _WIN32
7070
return(InterlockedDecrement((LONG *)&RefCount));
71-
#elif defined(__linux__)
71+
#elif defined(__GNUC__)
7272
return(__sync_sub_and_fetch(&RefCount, 1));
7373
#endif
7474
//TODO[Android]

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ namespace GmmLib
127127
{
128128
#if defined(_WIN32)
129129
return(InterlockedIncrement((LONG *)&RefCount) - 1); //InterLockedIncrement() returns incremented value
130-
#elif defined(__linux__)
130+
#elif defined(__GNUC__)
131131
return(__sync_fetch_and_add(&RefCount, 1));
132132
#endif
133133
}
@@ -149,7 +149,7 @@ namespace GmmLib
149149
}
150150
#if defined(_WIN32)
151151
} while (!(InterlockedCompareExchange((LONG *)&RefCount, TargetValue, CurrentValue) == CurrentValue));
152-
#elif defined(__linux__)
152+
#elif defined(__GNUC__)
153153
} while (!__sync_bool_compare_and_swap(&RefCount, CurrentValue, TargetValue));
154154
#endif
155155

Source/GmmLib/inc/Internal/Common/Texture/GmmTextureCalc.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ namespace GmmLib
175175
{
176176
#if defined(__GMM_KMD__) || _WIN32
177177
InterlockedIncrement((LONG *)&RefCount);
178-
#elif defined(__linux__)
178+
#elif defined(__GNUC__)
179179
__sync_fetch_and_add(&RefCount, 1);
180180
#endif
181181
//TODO[Android]
@@ -185,7 +185,7 @@ namespace GmmLib
185185
{
186186
#if defined(__GMM_KMD__) || _WIN32
187187
return(InterlockedDecrement((LONG *)&RefCount));
188-
#elif defined(__linux__)
188+
#elif defined(__GNUC__)
189189
return(__sync_sub_and_fetch(&RefCount, 1));
190190
#endif
191191
//TODO[Android]

0 commit comments

Comments
 (0)