mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
Attempt to fix QDataStream operator<< ODR violation
This commit is contained in:
parent
a052e3c452
commit
afe2dbd128
|
@ -17,6 +17,9 @@
|
|||
along with qTox. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#define QT_NO_DATASTREAM
|
||||
#include <QString>
|
||||
#undef QT_NO_DATASTREAM
|
||||
#include "settingsserializer.h"
|
||||
#include "serialize.h"
|
||||
#include "src/nexus.h"
|
||||
|
@ -36,12 +39,7 @@ inline QDataStream& operator<<(QDataStream& dataStream, const SettingsSerializer
|
|||
return dataStream << static_cast<uint8_t>(tag);
|
||||
}
|
||||
|
||||
inline QDataStream& operator<<(QDataStream& dataStream, const QString& str)
|
||||
{
|
||||
return dataStream << str.toUtf8();
|
||||
}
|
||||
|
||||
inline QDataStream& operator<<(QDataStream& dataStream, const QByteArray& data)
|
||||
static inline QDataStream& operator<<(QDataStream& dataStream, const QByteArray& data)
|
||||
{
|
||||
QByteArray size = vuintToData(data.size());
|
||||
dataStream.writeRawData(size.data(), size.size());
|
||||
|
@ -49,12 +47,17 @@ inline QDataStream& operator<<(QDataStream& dataStream, const QByteArray& data)
|
|||
return dataStream;
|
||||
}
|
||||
|
||||
static inline QDataStream& operator<<(QDataStream& dataStream, const QString& str)
|
||||
{
|
||||
return dataStream << str.toUtf8();
|
||||
}
|
||||
|
||||
QDataStream& operator>>(QDataStream& dataStream, SettingsSerializer::RecordTag& tag)
|
||||
{
|
||||
return dataStream.operator >>((uint8_t&)tag);
|
||||
}
|
||||
|
||||
inline QDataStream& operator>>(QDataStream& dataStream, QByteArray& data)
|
||||
static inline QDataStream& operator>>(QDataStream& dataStream, QByteArray& data)
|
||||
{
|
||||
unsigned char num3;
|
||||
size_t num = 0;
|
||||
|
|
Loading…
Reference in New Issue
Block a user