Bug 775428: add a long long template for OpenBSD/64bits, fixes build breakage after 745148. r=cjones

This commit is contained in:
Landry Breuil 2012-07-19 22:54:50 +02:00
parent a14ed4669d
commit cc75f7deee

View File

@ -193,6 +193,29 @@ struct ParamTraits<unsigned long long> {
l->append(StringPrintf(L"%ull", p));
}
};
template <>
struct ParamTraits<long long> {
typedef long long param_type;
static void Write(Message* m, const param_type& p) {
m->WriteData(reinterpret_cast<const char*>(&p), sizeof(param_type));
}
static bool Read(const Message* m, void** iter, param_type* r) {
const char *data;
int data_size = 0;
bool result = m->ReadData(iter, &data, &data_size);
if (result && data_size == sizeof(param_type)) {
memcpy(r, data, sizeof(param_type));
} else {
result = false;
NOTREACHED();
}
return result;
}
static void Log(const param_type& p, std::wstring* l) {
l->append(StringPrintf(L"%ll", p));
}
};
#endif
#if !(defined(OS_MACOSX) || defined(OS_OPENBSD) || defined(OS_WIN) || (defined(OS_LINUX) && defined(ARCH_CPU_64_BITS)) || defined(ARCH_CPU_S390))