Better support for MINW32
This commit is contained in:
parent
e7cc1ffc1e
commit
d2cef1515e
6 changed files with 19 additions and 6 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -37,3 +37,4 @@ config.sub
|
||||||
ar-lib
|
ar-lib
|
||||||
libwebsockets.pc
|
libwebsockets.pc
|
||||||
build/
|
build/
|
||||||
|
*.swp
|
||||||
|
|
|
@ -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_VENDOR "andy@warmcat.com")
|
||||||
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "${PACKAGE} ${PACKAGE_VERSION}")
|
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "${PACKAGE} ${PACKAGE_VERSION}")
|
||||||
set(SOVERSION "9")
|
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_GENERATOR "TGZ")
|
||||||
set(CPACK_SOURCE_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}")
|
set(CPACK_SOURCE_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}")
|
||||||
set(VERSION "${CPACK_PACKAGE_VERSION}")
|
set(VERSION "${CPACK_PACKAGE_VERSION}")
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -125,7 +125,7 @@ struct sockaddr_in;
|
||||||
// Visual studio older than 2015 and WIN_CE has only _stricmp
|
// Visual studio older than 2015 and WIN_CE has only _stricmp
|
||||||
#if (defined(_MSC_VER) && _MSC_VER < 1900) || defined(_WIN32_WCE)
|
#if (defined(_MSC_VER) && _MSC_VER < 1900) || defined(_WIN32_WCE)
|
||||||
#define strcasecmp _stricmp
|
#define strcasecmp _stricmp
|
||||||
#else
|
#elif !defined(__MINGW32__)
|
||||||
#define strcasecmp stricmp
|
#define strcasecmp stricmp
|
||||||
#endif
|
#endif
|
||||||
#define getdtablesize() 30000
|
#define getdtablesize() 30000
|
||||||
|
@ -148,7 +148,7 @@ struct sockaddr_in;
|
||||||
#define LWS_INVALID_FILE INVALID_HANDLE_VALUE
|
#define LWS_INVALID_FILE INVALID_HANDLE_VALUE
|
||||||
#define LWS_O_RDONLY _O_RDONLY
|
#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
|
#define lws_snprintf _snprintf
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -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); }
|
static inline int compatible_close(int fd) { return close(fd); }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(WIN32) || defined(_WIN32)
|
||||||
|
#include <gettimeofday.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(MBED_OPERATORS)
|
#if defined(MBED_OPERATORS)
|
||||||
#undef compatible_close
|
#undef compatible_close
|
||||||
#define compatible_close(fd) mbed3_delete_tcp_stream_socket(fd)
|
#define compatible_close(fd) mbed3_delete_tcp_stream_socket(fd)
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
#ifndef _GET_TIME_OF_DAY_H
|
#ifndef _GET_TIME_OF_DAY_H
|
||||||
#define _GET_TIME_OF_DAY_H
|
#define _GET_TIME_OF_DAY_H
|
||||||
|
|
||||||
|
#include <time.h>
|
||||||
|
|
||||||
#if defined(_MSC_VER) || defined(_MSC_EXTENSIONS)
|
#if defined(_MSC_VER) || defined(_MSC_EXTENSIONS)
|
||||||
#define DELTA_EPOCH_IN_MICROSECS 11644473600000000Ui64
|
#define DELTA_EPOCH_IN_MICROSECS 11644473600000000Ui64
|
||||||
#else
|
#else
|
||||||
|
@ -18,9 +20,8 @@ struct timezone
|
||||||
int tz_dsttime; /* type of dst correction */
|
int tz_dsttime; /* type of dst correction */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
int gettimeofday(struct timeval *tv, struct timezone *tz);
|
int gettimeofday(struct timeval *tv, struct timezone *tz);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue