Better support for MINW32

This commit is contained in:
Rainer Poisel 2016-11-07 21:36:05 +01:00 committed by Andy Green
parent e7cc1ffc1e
commit d2cef1515e
6 changed files with 19 additions and 6 deletions

1
.gitignore vendored
View file

@ -37,3 +37,4 @@ config.sub
ar-lib
libwebsockets.pc
build/
*.swp

View file

@ -15,6 +15,13 @@ set(CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSIO
set(CPACK_PACKAGE_VENDOR "andy@warmcat.com")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "${PACKAGE} ${PACKAGE_VERSION}")
set(SOVERSION "9")
if(NOT CPACK_GENERATOR)
if(UNIX)
set(CPACK_GENERATOR "TGZ")
else()
set(CPACK_GENERATOR "ZIP")
endif()
endif()
set(CPACK_SOURCE_GENERATOR "TGZ")
set(CPACK_SOURCE_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}")
set(VERSION "${CPACK_PACKAGE_VERSION}")

File diff suppressed because one or more lines are too long

View file

@ -125,7 +125,7 @@ struct sockaddr_in;
// Visual studio older than 2015 and WIN_CE has only _stricmp
#if (defined(_MSC_VER) && _MSC_VER < 1900) || defined(_WIN32_WCE)
#define strcasecmp _stricmp
#else
#elif !defined(__MINGW32__)
#define strcasecmp stricmp
#endif
#define getdtablesize() 30000
@ -148,7 +148,7 @@ struct sockaddr_in;
#define LWS_INVALID_FILE INVALID_HANDLE_VALUE
#define LWS_O_RDONLY _O_RDONLY
#if !defined(_MSC_VER) || _MSC_VER < 1900 /* Visual Studio 2015 already defines this in <stdio.h> */
#if !defined(__MINGW32__) && (!defined(_MSC_VER) || _MSC_VER < 1900) /* Visual Studio 2015 already defines this in <stdio.h> */
#define lws_snprintf _snprintf
#endif

View file

@ -291,6 +291,10 @@ lws_plat_get_peer_simple(struct lws *wsi, char *name, int namelen);
static inline int compatible_close(int fd) { return close(fd); }
#endif
#if defined(WIN32) || defined(_WIN32)
#include <gettimeofday.h>
#endif
#if defined(MBED_OPERATORS)
#undef compatible_close
#define compatible_close(fd) mbed3_delete_tcp_stream_socket(fd)

View file

@ -1,6 +1,8 @@
#ifndef _GET_TIME_OF_DAY_H
#define _GET_TIME_OF_DAY_H
#include <time.h>
#if defined(_MSC_VER) || defined(_MSC_EXTENSIONS)
#define DELTA_EPOCH_IN_MICROSECS 11644473600000000Ui64
#else
@ -18,9 +20,8 @@ struct timezone
int tz_dsttime; /* type of dst correction */
};
#endif
int gettimeofday(struct timeval *tv, struct timezone *tz);
#endif
#endif