mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-05 13:19:32 -04:00
Fix warning caused by clang defining _GNUC_
This commit is contained in:
parent
f26a0c793e
commit
e6e5700ed6
2 changed files with 12 additions and 4 deletions
|
@ -777,10 +777,14 @@ template<> bool p3FileDatabase::convertPointerToEntryIndex<4>(const void *p, Ent
|
||||||
{
|
{
|
||||||
// trust me, I can do this ;-)
|
// trust me, I can do this ;-)
|
||||||
|
|
||||||
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
|
#if defined(__GNUC__) && !defined(__clang__)
|
||||||
|
# pragma GCC diagnostic ignored "-Wstrict-aliasing"
|
||||||
|
#endif // defined(__GNUC__) && !defined(__clang__)
|
||||||
e = EntryIndex( *reinterpret_cast<uint32_t*>(&p) & ENTRY_INDEX_BIT_MASK_32BITS ) ;
|
e = EntryIndex( *reinterpret_cast<uint32_t*>(&p) & ENTRY_INDEX_BIT_MASK_32BITS ) ;
|
||||||
friend_index = (*reinterpret_cast<uint32_t*>(&p)) >> NB_ENTRY_INDEX_BITS_32BITS ;
|
friend_index = (*reinterpret_cast<uint32_t*>(&p)) >> NB_ENTRY_INDEX_BITS_32BITS ;
|
||||||
#pragma GCC diagnostic pop
|
#if defined(__GNUC__) && !defined(__clang__)
|
||||||
|
# pragma GCC diagnostic pop
|
||||||
|
#endif // defined(__GNUC__) && !defined(__clang__)
|
||||||
|
|
||||||
if(friend_index == 0)
|
if(friend_index == 0)
|
||||||
{
|
{
|
||||||
|
@ -817,10 +821,14 @@ template<> bool p3FileDatabase::convertPointerToEntryIndex<8>(const void *p, Ent
|
||||||
{
|
{
|
||||||
// trust me, I can do this ;-)
|
// trust me, I can do this ;-)
|
||||||
|
|
||||||
|
#if defined(__GNUC__) && !defined(__clang__)
|
||||||
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
|
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
|
||||||
|
#endif // defined(__GNUC__) && !defined(__clang__)
|
||||||
e = EntryIndex( *reinterpret_cast<uint64_t*>(&p) & ENTRY_INDEX_BIT_MASK_64BITS ) ;
|
e = EntryIndex( *reinterpret_cast<uint64_t*>(&p) & ENTRY_INDEX_BIT_MASK_64BITS ) ;
|
||||||
friend_index = (*reinterpret_cast<uint64_t*>(&p)) >> NB_ENTRY_INDEX_BITS_64BITS ;
|
friend_index = (*reinterpret_cast<uint64_t*>(&p)) >> NB_ENTRY_INDEX_BITS_64BITS ;
|
||||||
|
#if defined(__GNUC__) && !defined(__clang__)
|
||||||
#pragma GCC diagnostic pop
|
#pragma GCC diagnostic pop
|
||||||
|
#endif // defined(__GNUC__) && !defined(__clang__)
|
||||||
|
|
||||||
if(friend_index == 0)
|
if(friend_index == 0)
|
||||||
{
|
{
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#ifdef __GNUC__
|
#if defined(__GNUC__) && !defined(__clang__)
|
||||||
# define GCC_VERSION (__GNUC__*10000+__GNUC_MINOR__*100+__GNUC_PATCHLEVEL__)
|
# define GCC_VERSION (__GNUC__*10000+__GNUC_MINOR__*100+__GNUC_PATCHLEVEL__)
|
||||||
# if GCC_VERSION < 40700
|
# if GCC_VERSION < 40700
|
||||||
# define override
|
# define override
|
||||||
|
@ -30,4 +30,4 @@
|
||||||
# if GCC_VERSION < 40600
|
# if GCC_VERSION < 40600
|
||||||
# define nullptr NULL
|
# define nullptr NULL
|
||||||
# endif // GCC_VERSION < 40600
|
# endif // GCC_VERSION < 40600
|
||||||
#endif //defined GNUC
|
#endif // defined(__GNUC__) && !defined(__clang__)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue