Windows msvc: rename dirent.h->msvc_dirent.h. mh_text: fix mimeconf-win and warning

This commit is contained in:
Jean-Francois Dockes 2020-08-15 10:12:36 +01:00
parent 9bc49866e5
commit d9c1a9648c
7 changed files with 42 additions and 27 deletions

View File

@ -198,7 +198,7 @@ bool MimeHandlerText::readnext()
return false;
}
} else {
m_text = m_alltext.substr(m_offs, m_pagesz);
m_text = m_alltext.substr((size_t)m_offs, m_pagesz);
}
if (m_text.length() == 0) {

View File

@ -21,31 +21,33 @@
// Generic Xapian exception catching code. We do this quite often,
// and I have no idea how to do this except for a macro
#define XCATCHERROR(MSG) \
catch (const Xapian::Error &e) { \
MSG = e.get_msg(); \
if (MSG.empty()) MSG = "Empty error message"; \
} catch (const std::string &s) { \
MSG = s; \
if (MSG.empty()) MSG = "Empty error message"; \
} catch (const char *s) { \
MSG = s; \
if (MSG.empty()) MSG = "Empty error message"; \
} catch (...) { \
MSG = "Caught unknown xapian exception"; \
}
catch (const Xapian::Error &e) { \
MSG = e.get_msg(); \
if (MSG.empty()) MSG = "Empty error message"; \
} catch (const std::string &s) { \
MSG = s; \
if (MSG.empty()) MSG = "Empty error message"; \
} catch (const char *s) { \
MSG = s; \
if (MSG.empty()) MSG = "Empty error message"; \
} catch (std::exception& ex) { \
MSG = std::string("Caught std::exception: ") + ex.what(); \
} catch (...) { \
MSG = std::string("Caught unknown exception??"); \
}
#define XAPTRY(STMTTOTRY, XAPDB, ERSTR) \
for (int tries = 0; tries < 2; tries++) { \
try { \
STMTTOTRY; \
ERSTR.erase(); \
break; \
} catch (const Xapian::DatabaseModifiedError &e) { \
ERSTR = e.get_msg(); \
XAPDB.reopen(); \
continue; \
} XCATCHERROR(ERSTR); \
break; \
#define XAPTRY(STMTTOTRY, XAPDB, ERSTR) \
for (int tries = 0; tries < 2; tries++) { \
try { \
STMTTOTRY; \
ERSTR.erase(); \
break; \
} catch (const Xapian::DatabaseModifiedError &e) { \
ERSTR = e.get_msg(); \
XAPDB.reopen(); \
continue; \
} XCATCHERROR(ERSTR); \
break; \
}
#endif

View File

@ -18,7 +18,13 @@
#include "autoconfig.h"
#include <stdio.h>
#ifdef _MSC_VER
#include "msvc_dirent.h"
#else // !_MSC_VER
#include <dirent.h>
#endif // _MSC_VER
#include <errno.h>
#include <fnmatch.h>
#include <cstring>

View File

@ -22,7 +22,6 @@
#include <stdlib.h>
#include "safefcntl.h"
#include "safeunistd.h"
#include "dirent.h"
#include "cstr.h"
#ifdef _WIN32
#include "safewindows.h"

View File

@ -21,7 +21,6 @@
#include <stdio.h>
#include <errno.h>
#include <dirent.h>
#include <cstring>
#include <string>
@ -29,6 +28,12 @@
#include "log.h"
#include "pathut.h"
#ifdef _MSC_VER
#include "msvc_dirent.h"
#else // !_MSC_VER
#include <dirent.h>
#endif // _MSC_VER
#ifdef _WIN32
#include "safefcntl.h"
#include "safeunistd.h"

View File

@ -173,6 +173,7 @@ text/calendar = execm python rclics;mimetype=text/plain
text/css = internal text/plain
text/html = internal
text/plain = internal
text/plain1 = internal
#text/rtf = execm python rclrtf.py
text/rtf = exec unrtf --nopict --html;mimetype=text/html
text/x-c = internal

View File

@ -167,6 +167,7 @@ copyrecoll()
chkcp $RCL/windows/mimeview $DESTDIR/Share/examples
chkcp $RCL/sampleconf/recoll.conf $DESTDIR/Share/examples
chkcp $RCL/sampleconf/recoll.qss $DESTDIR/Share/examples
chkcp $RCL/sampleconf/recoll-dark.qss $DESTDIR/Share/examples
chkcp $RCL/python/recoll/recoll/rclconfig.py $FILTERS
chkcp $RCL/python/recoll/recoll/conftree.py $FILTERS
@ -312,6 +313,7 @@ copypyrecoll()
PYRCLWHEEL=${PYRECOLL}/dist/Recoll-${VERSION}-cp37-cp37m-win32.whl
DEST=${DESTDIR}/Share/dist
test -d $DEST || mkdir $DEST || fatal cant create $DEST
rm -f ${DEST}/*
chkcp ${PYRCLWHEEL} $DEST
fi
}