mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-23 00:00:06 +01:00

This adds win32 build compatability to libwebsockets. The patch is from Peter Hinz, Andy Green has cleaned it up a bit and possibly broken win32 compatability since I can't test it, so there may be followup patches. It compiles fine under Linux after this patch anyway. Much of the patch is changing a reserved keyword for Visual C compiler "this" to "context", but there is no real C99 support in the MSFT compiler even though it is 2011 so C99 style array declarations have been mangled back into "ancient C" style. Some windows-isms are also added like closesocket() but these are quite localized. Win32 random is just using C library random() call at the moment vs Linux /dev/urandom. canonical hostname detection is broken in win32 at the moment. Signed-off-by: Peter Hinz <cerebusrc@gmail.com> Signed-off-by: Andy Green <andy@warmcat.com>
21 lines
No EOL
319 B
C
21 lines
No EOL
319 B
C
#ifndef __WEB_SOCK_W32_H__
|
|
#define __WEB_SOCK_W32_H__
|
|
|
|
// Windows uses _DEBUG and NDEBUG
|
|
#ifdef _DEBUG
|
|
#undef DEBUG
|
|
#define DEBUG 1
|
|
#endif
|
|
|
|
#define bzero(b,len) (memset((b), '\0', (len)), (void) 0)
|
|
|
|
#define MSG_NOSIGNAL 0
|
|
#define SHUT_RDWR SD_BOTH
|
|
|
|
#define poll WSAPoll
|
|
|
|
#define LWS_NO_FORK
|
|
|
|
#define DATADIR "."
|
|
|
|
#endif |