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
This commit is contained in:
Matthieu Gautier 2017-01-17 10:26:04 +01:00
parent 1d2a9879cc
commit 9aa7e371f7
2 changed files with 9 additions and 5 deletions

View File

@ -21,7 +21,7 @@
#include <getopt.h>
#ifdef _WIN32
#include <Windows.h>
#include <windows.h>
#else
#include <unistd.h>
#endif

View File

@ -27,14 +27,14 @@
#ifdef _WIN32
#if (_MSC_VER < 1600)
#if !defined(__MINGW32__) && (_MSC_VER < 1600)
#include "stdint4win.h"
#endif
#include <winsock2.h>
#include <WS2tcpip.h> // otherwise socklen_t is not a recognized type
#include <ws2tcpip.h> // otherwise socklen_t is not a recognized type
//#include <Windows.h> // 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 <ifaddrs.h>
#endif
#ifdef interface
#undef interface
#endif
using namespace std;
static bool nosearchbarFlag = false;