Fix Android compilation

This commit is contained in:
Gioacchino Mazzurco 2018-01-22 11:09:00 +01:00
parent bc0990e3c8
commit b95e3380c0
3 changed files with 31 additions and 0 deletions

View file

@ -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)

View file

@ -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 */