mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 18:18:06 +02:00
util: Implement p_atomic_read for C++ properly.
../src/compiler/glsl/ast_function.cpp ..\src\util/u_cpu_detect.h(168): error C2220: the following warning is treated as an error ..\src\util/u_cpu_detect.h(168): warning C4197: 'uint32_t *volatile ': top-level volatile in cast is ignored [325/1703] Compiling C++ object src/compiler/glsl/libglsl.a.p/builtin_functions.cpp.obj Signed-off-by: Yonggang Luo <luoyonggang@gmail.com> Reviewed-by: Jesse Natalie <jenatali@microsoft.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36863>
This commit is contained in:
parent
de1a2a3537
commit
dda1692484
1 changed files with 1 additions and 1 deletions
|
|
@ -139,7 +139,7 @@ __forceinline short _interlockedadd16(short volatile * _Addend, short _Value)
|
|||
#define p_atomic_set(_v, _i) (*(_v) = (_i))
|
||||
#if defined(__cplusplus)
|
||||
#include <type_traits>
|
||||
#define p_atomic_read(_v) (*reinterpret_cast<std::add_volatile_t<decltype(_v)>>(_v))
|
||||
#define p_atomic_read(_v) (*reinterpret_cast<std::add_pointer_t<std::add_volatile_t<std::remove_pointer_t<decltype(_v)>>>>(_v))
|
||||
#else
|
||||
#define p_atomic_read(_v) (_Generic(*(_v), \
|
||||
bool : *((volatile bool*) (_v)), \
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue