Skip to content

Commit 4dfefa1

Browse files
Fix compilation error
1 parent 11a2a6c commit 4dfefa1

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/tbson.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include <TBson>
1515
#include <atomic>
1616
extern "C" {
17+
#include <mongoc/mongoc.h>
1718
#include <bson/bson.h>
1819
}
1920

@@ -237,7 +238,11 @@ static bool appendBsonValue(bson_t *bson, const QString &key, const QVariant &va
237238
case QMetaType::QVariantList: // FALLTHRU
238239
case QMetaType::QStringList: {
239240
bson_t child;
241+
#if MONGOC_CHECK_VERSION(2, 3, 0)
240242
BSON_APPEND_ARRAY_UNSAFE_BEGIN(bson, qUtf8Printable(key), &child);
243+
#else
244+
BSON_APPEND_ARRAY_BEGIN(bson, qUtf8Printable(key), &child);
245+
#endif
241246

242247
int i = 0;
243248
for (auto &var : (const QList<QVariant> &)value.toList()) {

0 commit comments

Comments
 (0)