From fed748b1906591080879715a776c3a61c63e1c73 Mon Sep 17 00:00:00 2001 From: Jean-Francois Dockes Date: Sat, 3 Oct 2015 10:21:24 +0200 Subject: [PATCH] Windows: tests with building librecoll with mingw --- src/common/autoconfig-win.h | 2 +- src/common/conf_post.h | 32 +++++++++++++++++++++----------- src/windows/execmd_w.cpp | 7 ++++--- 3 files changed, 26 insertions(+), 15 deletions(-) diff --git a/src/common/autoconfig-win.h b/src/common/autoconfig-win.h index 349a2b98..03a9c8a4 100644 --- a/src/common/autoconfig-win.h +++ b/src/common/autoconfig-win.h @@ -21,7 +21,7 @@ overriden in the c++ code by ifdefs _WIN32 anyway */ #define FILE_PROG "/usr/bin/file" /* "Have C++0x" */ -#undef HAVE_CXX0X_UNORDERED +#define HAVE_CXX0X_UNORDERED 1 /* Define to 1 if you have the header file. */ #define HAVE_DLFCN_H 1 diff --git a/src/common/conf_post.h b/src/common/conf_post.h index f6bfcb70..b018ae56 100644 --- a/src/common/conf_post.h +++ b/src/common/conf_post.h @@ -28,6 +28,25 @@ #ifdef _WIN32 #include "safewindows.h" + +#undef RCL_ICONV_INBUF_CONST + +#ifdef _MSC_VER +// gmtime is supposedly thread-safe on windows +#define gmtime_r(A, B) gmtime(A) +#define localtime_r(A,B) localtime(A) +typedef int mode_t; +#define fseeko _fseeki64 +#define ftello (off_t)_ftelli64 +#define ftruncate _chsize_s +#define PATH_MAX MAX_PATH +#define RCL_ICONV_INBUF_CONST 1 +#else +// Gminw +#undef RCL_ICONV_INBUF_CONST +#endif + + typedef int pid_t; inline int readlink(const char *cp, void *buf, int cnt) { return -1; @@ -35,18 +54,9 @@ inline int readlink(const char *cp, void *buf, int cnt) { #define HAVE_STRUCT_TIMESPEC #define strdup _strdup #define timegm _mkgmtime -#ifdef _MSC_VER -// gmtime is supposedly thread-safe on windows -#define gmtime_r(A, B) gmtime(A) -#define localtime_r(A,B) localtime(A) -#define PATH_MAX MAX_PATH -#define MAXPATHLEN PATH_MAX -typedef int mode_t; -#define fseeko _fseeki64 -#define ftello (off_t)_ftelli64 -#define ftruncate _chsize_s -#endif + +#define MAXPATHLEN PATH_MAX typedef DWORD32 u_int32_t; typedef DWORD64 u_int64_t; typedef unsigned __int8 u_int8_t; diff --git a/src/windows/execmd_w.cpp b/src/windows/execmd_w.cpp index 5621749f..81fd9486 100644 --- a/src/windows/execmd_w.cpp +++ b/src/windows/execmd_w.cpp @@ -5,6 +5,7 @@ #include #include #include +#include UNORDERED_MAP_INCLUDE #include "debuglog.h" #include "safesysstat.h" @@ -430,11 +431,11 @@ void ExecCmd::zapChild() bool ExecCmd::requestChildExit() { - if (m_piProcInfo.hProcess) { + if (m->m_piProcInfo.hProcess) { LOGDEB(("ExecCmd: GenerateConsoleCtrlEvent -> %d\n", - m_piProcInfo.dwProcessId)); + m->m_piProcInfo.dwProcessId)); return GenerateConsoleCtrlEvent(CTRL_BREAK_EVENT, - m_piProcInfo.dwProcessId); + m->m_piProcInfo.dwProcessId); } return false; }