mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-01-13 08:29:32 -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(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
|
||||
// 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.
|
||||
@ -295,6 +298,9 @@ struct DirStub : RsSerializable
|
||||
else
|
||||
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
|
||||
template<typename T>
|
||||
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 || std::is_same<unsigned long,T>::value)>::type
|
||||
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
|
||||
static /*void*/ serial_process( RsGenericSerializer::SerializeJob j,
|
||||
RsGenericSerializer::SerializeContext& ctx,
|
||||
T& member, const std::string& member_name )
|
||||
|
Loading…
Reference in New Issue
Block a user