diff --git a/src/io/dataBuffer.h b/src/io/dataBuffer.h index 74586ca..23d0d28 100644 --- a/src/io/dataBuffer.h +++ b/src/io/dataBuffer.h @@ -178,6 +178,13 @@ class DataBuffer i = readVLQu64(); } +#ifdef __MACOS__ + void read(size_t& i) + { + i = readVLQu64(); + } +#endif + void read(float& f) { if (read_index + sizeof(f) > buffer.size()) { f = 0; return; } @@ -234,6 +241,11 @@ class DataBuffer DataBuffer& operator >>(double& data) { read(data); return *this; } DataBuffer& operator >>(string& data) { read(data); return *this; } +#ifdef __MACOS__ + DataBuffer& operator <<(size_t data) { write(uint64_t(data)); return *this; } + DataBuffer& operator >>(size_t& data) { read(data); return *this; } +#endif + template>> DataBuffer& operator <<(T data) { write(int(data)); return *this; } template>> DataBuffer& operator >>(T& data) { int n = 0; read(n); data = T(n); return *this; } private: