mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
Fix compilation on systems with atipic time_t
This commit is contained in:
parent
234625ad28
commit
7409de5170
@ -199,7 +199,6 @@ template<> bool RsTypeSerializer::to_JSON( const std::string& memberName, \
|
|||||||
SIMPLE_TO_JSON_DEF(bool)
|
SIMPLE_TO_JSON_DEF(bool)
|
||||||
SIMPLE_TO_JSON_DEF(int32_t)
|
SIMPLE_TO_JSON_DEF(int32_t)
|
||||||
|
|
||||||
#ifdef __ANDROID__
|
|
||||||
template<> bool RsTypeSerializer::to_JSON( const std::string& memberName,
|
template<> bool RsTypeSerializer::to_JSON( const std::string& memberName,
|
||||||
const time_t& member, RsJson& jDoc )
|
const time_t& member, RsJson& jDoc )
|
||||||
{
|
{
|
||||||
@ -208,6 +207,7 @@ template<> bool RsTypeSerializer::to_JSON( const std::string& memberName,
|
|||||||
rapidjson::Value key;
|
rapidjson::Value key;
|
||||||
key.SetString(memberName.c_str(), memberName.length(), allocator);
|
key.SetString(memberName.c_str(), memberName.length(), allocator);
|
||||||
|
|
||||||
|
// without this compilation may break depending on how time_t is defined
|
||||||
int64_t tValue = member;
|
int64_t tValue = member;
|
||||||
rapidjson::Value value(tValue);
|
rapidjson::Value value(tValue);
|
||||||
|
|
||||||
@ -215,9 +215,6 @@ template<> bool RsTypeSerializer::to_JSON( const std::string& memberName,
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
SIMPLE_TO_JSON_DEF(time_t)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
SIMPLE_TO_JSON_DEF(uint8_t)
|
SIMPLE_TO_JSON_DEF(uint8_t)
|
||||||
SIMPLE_TO_JSON_DEF(uint16_t)
|
SIMPLE_TO_JSON_DEF(uint16_t)
|
||||||
|
Loading…
Reference in New Issue
Block a user