File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed
vendor/sparsehash/src/sparsehash/internal Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change 5050_START_GOOGLE_NAMESPACE_
5151
5252template <bool > struct SparsehashCompileAssert { };
53- #define SPARSEHASH_COMPILE_ASSERT (expr, msg ) \
54- [[maybe_unused]] typedef SparsehashCompileAssert<(bool (expr))> msg[bool (expr) ? 1 : -1 ]
53+
54+ // Cross-platform compatibility for unused attribute
55+ #if __cplusplus >= 201703L || (defined(_MSVC_LANG) && _MSVC_LANG >= 201703L)
56+ #define SPARSEHASH_COMPILE_ASSERT (expr, msg ) \
57+ [[maybe_unused]] typedef SparsehashCompileAssert<(bool (expr))> msg[bool (expr) ? 1 : -1 ]
58+ #elif defined(__GNUC__) || defined(__clang__)
59+ // GCC or Clang: use GNU attribute
60+ #define SPARSEHASH_COMPILE_ASSERT (expr, msg ) \
61+ __attribute__ ((unused)) typedef SparsehashCompileAssert<(bool (expr))> msg[bool(expr) ? 1 : -1]
62+ #else
63+ // Other compilers: No attribute
64+ #define SPARSEHASH_COMPILE_ASSERT (expr, msg ) \
65+ typedef SparsehashCompileAssert<(bool (expr))> msg[bool (expr) ? 1 : -1 ]
66+ #endif
5567
5668namespace sparsehash_internal {
5769
You can’t perform that action at this time.
0 commit comments