From 9aa7e371f75eb07738c207bf38f7f92377752c3a Mon Sep 17 00:00:00 2001 From: Matthieu Gautier Date: Tue, 17 Jan 2017 10:26:04 +0100 Subject: [PATCH] Fix header include for cross-compilation to Windows. - On unix, filenames are case sensitive and all include files are lowercase - When crosscompiling to Windows, we use mingw32 and not msc. So we should not try to include "stdint4win.h" - Windows includes #define interface to struct. As we use interface as variable name, we need to undef interface --- src/indexer/kiwix-index.cpp | 2 +- src/server/kiwix-serve.cpp | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/indexer/kiwix-index.cpp b/src/indexer/kiwix-index.cpp index e797346..36442e9 100644 --- a/src/indexer/kiwix-index.cpp +++ b/src/indexer/kiwix-index.cpp @@ -21,7 +21,7 @@ #include #ifdef _WIN32 -#include +#include #else #include #endif diff --git a/src/server/kiwix-serve.cpp b/src/server/kiwix-serve.cpp index ad0435e..b51b18c 100644 --- a/src/server/kiwix-serve.cpp +++ b/src/server/kiwix-serve.cpp @@ -27,14 +27,14 @@ #ifdef _WIN32 -#if (_MSC_VER < 1600) +#if !defined(__MINGW32__) && (_MSC_VER < 1600) #include "stdint4win.h" #endif #include -#include // otherwise socklen_t is not a recognized type +#include // otherwise socklen_t is not a recognized type //#include // otherwise int is not a recognized type -typedef int off_t; -typedef SSIZE_T ssize_t; +//typedef int off_t; +//typedef SSIZE_T ssize_t; typedef UINT64 uint64_t; typedef UINT16 uint16_t; extern "C" { @@ -78,6 +78,10 @@ extern "C" { #include #endif +#ifdef interface +#undef interface +#endif + using namespace std; static bool nosearchbarFlag = false;