mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-02 14:16:16 -04:00
Fix Android compilation
This commit is contained in:
parent
bc0990e3c8
commit
b95e3380c0
3 changed files with 31 additions and 0 deletions
|
@ -199,7 +199,27 @@ template<> bool RsTypeSerializer::to_JSON( const std::string& memberName, \
|
|||
|
||||
SIMPLE_TO_JSON_DEF(bool)
|
||||
SIMPLE_TO_JSON_DEF(int32_t)
|
||||
|
||||
#ifdef __ANDROID__
|
||||
template<> bool RsTypeSerializer::to_JSON( const std::string& memberName,
|
||||
const time_t& member, RsJson& jDoc )
|
||||
{
|
||||
rapidjson::Document::AllocatorType& allocator = jDoc.GetAllocator();
|
||||
|
||||
rapidjson::Value key;
|
||||
key.SetString(memberName.c_str(), memberName.length(), allocator);
|
||||
|
||||
int64_t tValue = member;
|
||||
rapidjson::Value value(tValue);
|
||||
|
||||
jDoc.AddMember(key, value, allocator);
|
||||
|
||||
return true;
|
||||
}
|
||||
#else
|
||||
SIMPLE_TO_JSON_DEF(time_t)
|
||||
#endif
|
||||
|
||||
SIMPLE_TO_JSON_DEF(uint8_t)
|
||||
SIMPLE_TO_JSON_DEF(uint16_t)
|
||||
SIMPLE_TO_JSON_DEF(uint32_t)
|
||||
|
|
|
@ -36,6 +36,8 @@
|
|||
#include "serialiser/rsserializable.h"
|
||||
|
||||
#include <rapidjson/document.h>
|
||||
#include <typeinfo> // for typeid
|
||||
|
||||
|
||||
/** INTERNAL ONLY helper to avoid copy paste code for std::{vector,list,set}<T>
|
||||
* Can't use a template function because T is needed for const_cast */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue