Commit 265f2feb authored by Laurent Montel's avatar Laurent Montel 😁

Fix build on windows

parent 8b24e441
......@@ -27,11 +27,12 @@
#if defined(HAVE_MALLOC_H)
#include <malloc.h>
#include <unistd.h>
#endif
#ifdef WIN32
#include <Windows.h>
#else
#include <unistd.h>
#endif
using namespace Akonadi::Search;
XapianDatabase::XapianDatabase(const QString &path, bool writeOnly)
......@@ -176,9 +177,17 @@ Xapian::WritableDatabase XapianDatabase::createWritableDb()
Xapian::WritableDatabase wdb(m_path, Xapian::DB_CREATE_OR_OPEN);
return wdb;
} catch (const Xapian::DatabaseLockError &) {
#ifdef WIN32
Sleep(i * 50 * 1000);
#else
usleep(i * 50 * 1000);
#endif
} catch (const Xapian::DatabaseModifiedError &) {
#ifdef WIN32
Sleep(i * 50 * 1000);
#else
usleep(i * 50 * 1000);
#endif
} catch (const Xapian::DatabaseCreateError &err) {
qCDebug(AKONADI_SEARCH_XAPIAN_LOG) << err.get_error_string();
return Xapian::WritableDatabase();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment