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; return false;
} }
} else { } 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) { if (m_text.length() == 0) {

View File

@ -30,8 +30,10 @@
} catch (const char *s) { \ } catch (const char *s) { \
MSG = s; \ MSG = s; \
if (MSG.empty()) MSG = "Empty error message"; \ if (MSG.empty()) MSG = "Empty error message"; \
} catch (std::exception& ex) { \
MSG = std::string("Caught std::exception: ") + ex.what(); \
} catch (...) { \ } catch (...) { \
MSG = "Caught unknown xapian exception"; \ MSG = std::string("Caught unknown exception??"); \
} }
#define XAPTRY(STMTTOTRY, XAPDB, ERSTR) \ #define XAPTRY(STMTTOTRY, XAPDB, ERSTR) \

View File

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

View File

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

View File

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

View File

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

View File

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