Skip to content

Commit c090ac4

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 978f7d5 commit c090ac4

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
@@ -589,7 +589,7 @@ int32_t GMM_STDCALL GmmLib::GmmMultiAdapterContext::IncrementRefCount(ADAPTER_BD
589589

590590
#if defined(_WIN32)
591591
return (InterlockedIncrement((LONG *)Ref) - 1); //InterLockedIncrement() returns incremented value
592-
#elif defined(__linux__)
592+
#elif defined(__GNUC__)
593593
return (__sync_fetch_and_add(Ref, 1));
594594
#endif
595595
}
@@ -626,7 +626,7 @@ int32_t GMM_STDCALL GmmLib::GmmMultiAdapterContext::DecrementRefCount(ADAPTER_BD
626626
}
627627
#if defined(_WIN32)
628628
} while(!(InterlockedCompareExchange((LONG *)Ref, TargetValue, CurrentValue) == CurrentValue));
629-
#elif defined(__linux__)
629+
#elif defined(__GNUC__)
630630
} while(!__sync_bool_compare_and_swap(Ref, CurrentValue, TargetValue));
631631
#endif
632632

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)