mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-01-27 15:57:08 -05:00
removed test for unsigned long in serialization, and added back pragma to avoid strict aliasing error in rstypes.h
This commit is contained in:
parent
3836ed836b
commit
ad45a7781c
@ -278,6 +278,9 @@ struct DirStub : RsSerializable
|
|||||||
RS_SERIAL_PROCESS(type);
|
RS_SERIAL_PROCESS(type);
|
||||||
RS_SERIAL_PROCESS(name);
|
RS_SERIAL_PROCESS(name);
|
||||||
|
|
||||||
|
#if defined(__GNUC__) && !defined(__clang__)
|
||||||
|
# pragma GCC diagnostic ignored "-Wstrict-aliasing"
|
||||||
|
#endif // defined(__GNUC__) && !defined(__clang__)
|
||||||
// (Cyril) We have to do this because on some systems (MacOS) uintptr_t is unsigned long which is not well defined. It is always
|
// (Cyril) We have to do this because on some systems (MacOS) uintptr_t is unsigned long which is not well defined. It is always
|
||||||
// preferable to force type serialization to the correct size rather than letting the compiler choose for us.
|
// preferable to force type serialization to the correct size rather than letting the compiler choose for us.
|
||||||
// /!\ This structure cannot be sent over the network. The serialization would be inconsistent.
|
// /!\ This structure cannot be sent over the network. The serialization would be inconsistent.
|
||||||
@ -295,6 +298,9 @@ struct DirStub : RsSerializable
|
|||||||
else
|
else
|
||||||
std::cerr << __PRETTY_FUNCTION__ << ": cannot serialize raw pointer of size " << sizeof(ref) << std::endl;
|
std::cerr << __PRETTY_FUNCTION__ << ": cannot serialize raw pointer of size " << sizeof(ref) << std::endl;
|
||||||
|
|
||||||
|
#if defined(__GNUC__) && !defined(__clang__)
|
||||||
|
# pragma GCC diagnostic pop
|
||||||
|
#endif // defined(__GNUC__) && !defined(__clang__)
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -131,8 +131,7 @@ struct RsTypeSerializer
|
|||||||
|
|
||||||
/// Generic types
|
/// Generic types
|
||||||
template<typename T>
|
template<typename T>
|
||||||
typename std::enable_if<std::is_same<RsTlvItem,T>::value
|
typename std::enable_if<std::is_same<RsTlvItem,T>::value || !(std::is_base_of<RsSerializable,T>::value || std::is_enum<T>::value || std::is_base_of<RsTlvItem,T>::value )>::type
|
||||||
|| !(std::is_base_of<RsSerializable,T>::value || std::is_enum<T>::value || std::is_base_of<RsTlvItem,T>::value || std::is_same<unsigned long,T>::value)>::type
|
|
||||||
static /*void*/ serial_process( RsGenericSerializer::SerializeJob j,
|
static /*void*/ serial_process( RsGenericSerializer::SerializeJob j,
|
||||||
RsGenericSerializer::SerializeContext& ctx,
|
RsGenericSerializer::SerializeContext& ctx,
|
||||||
T& member, const std::string& member_name )
|
T& member, const std::string& member_name )
|
||||||
|
Loading…
x
Reference in New Issue
Block a user