diff --git a/lib/libwebsockets.h b/lib/libwebsockets.h index d0cdfb6b..b407c629 100644 --- a/lib/libwebsockets.h +++ b/lib/libwebsockets.h @@ -151,6 +151,10 @@ struct sockaddr_in; #define snprintf _snprintf #endif +#ifndef __func__ +#define __func__ __FUNCTION__ +#endif + #else /* NOT WIN32 */ #include @@ -1368,7 +1372,7 @@ extern int lws_extension_callback_pm_deflate( struct lws *wsi, enum lws_extension_callback_reasons reason, void *user, void *in, size_t len); -LWS_EXTERN int +LWS_VISIBLE LWS_EXTERN int lws_set_extension_option(struct lws *wsi, const char *ext_name, const char *opt_name, const char *opt_val); @@ -1608,10 +1612,10 @@ enum { LWSMPRO_REDIR_HTTPS, }; -LWS_EXTERN int +LWS_VISIBLE LWS_EXTERN int lws_json_dump_vhost(const struct lws_vhost *vh, char *buf, int len); -LWS_EXTERN int +LWS_VISIBLE LWS_EXTERN int lws_json_dump_context(const struct lws_context *context, char *buf, int len); LWS_VISIBLE LWS_EXTERN void @@ -1626,20 +1630,20 @@ lws_create_context(struct lws_context_creation_info *info); struct lws_vhost; -LWS_VISIBLE struct lws_vhost * +LWS_EXTERN LWS_VISIBLE struct lws_vhost * lws_create_vhost(struct lws_context *context, struct lws_context_creation_info *info); -LWS_VISIBLE struct lws_vhost * +LWS_VISIBLE LWS_EXTERN struct lws_vhost * lws_vhost_get(struct lws *wsi); -LWS_VISIBLE const struct lws_protocols * +LWS_VISIBLE LWS_EXTERN const struct lws_protocols * lws_protocol_get(struct lws *wsi); -LWS_VISIBLE void * +LWS_VISIBLE LWS_EXTERN void * lws_protocol_vh_priv_zalloc(struct lws_vhost *vhost, const struct lws_protocols *prot, int size); -LWS_VISIBLE void * +LWS_VISIBLE LWS_EXTERN void * lws_protocol_vh_priv_get(struct lws_vhost *vhost, const struct lws_protocols *prot); LWS_VISIBLE LWS_EXTERN int @@ -1709,7 +1713,7 @@ lws_ev_sigint_cfg(struct lws_context *context, int use_ev_sigint, LWS_VISIBLE LWS_EXTERN int lws_ev_initloop(struct lws_context *context, struct ev_loop *loop, int tsi); -LWS_VISIBLE void +LWS_VISIBLE LWS_EXTERN void lws_ev_sigint_cb(struct ev_loop *loop, struct ev_signal *watcher, int revents); #endif /* LWS_USE_LIBEV */ @@ -1721,7 +1725,7 @@ lws_uv_sigint_cfg(struct lws_context *context, int use_uv_sigint, LWS_VISIBLE LWS_EXTERN void lws_libuv_run(const struct lws_context *context, int tsi); -LWS_VISIBLE void +LWS_VISIBLE LWS_EXTERN void lws_libuv_stop(struct lws_context *context); LWS_VISIBLE LWS_EXTERN int @@ -1730,7 +1734,7 @@ lws_uv_initloop(struct lws_context *context, uv_loop_t *loop, int tsi); LWS_VISIBLE LWS_EXTERN uv_loop_t * lws_uv_getloop(struct lws_context *context, int tsi); -LWS_VISIBLE void +LWS_VISIBLE LWS_EXTERN void lws_uv_sigint_cb(uv_signal_t *watcher, int signum); #endif /* LWS_USE_LIBUV */ @@ -1884,7 +1888,7 @@ LWS_VISIBLE LWS_EXTERN int lws_callback_on_writable_all_protocol(const struct lws_context *context, const struct lws_protocols *protocol); -LWS_VISIBLE int +LWS_VISIBLE LWS_EXTERN int lws_callback_on_writable_all_protocol_vhost(const struct lws_vhost *vhost, const struct lws_protocols *protocol); @@ -1892,7 +1896,7 @@ LWS_VISIBLE LWS_EXTERN int lws_callback_all_protocol(struct lws_context *context, const struct lws_protocols *protocol, int reason); -LWS_VISIBLE int +LWS_VISIBLE LWS_EXTERN int lws_callback_all_protocol_vhost(struct lws_vhost *vh, const struct lws_protocols *protocol, int reason); diff --git a/lwsws/http.c b/lwsws/http.c index 4ae8ccf3..9ffc779c 100644 --- a/lwsws/http.c +++ b/lwsws/http.c @@ -149,7 +149,7 @@ int callback_http(struct lws *wsi, enum lws_callback_reasons reason, void *user, #endif if (strlen(in) >= 12 && - !strncmp(in + strlen(in) - 12, "/postresults", 12)) { + !strncmp((char *)in + strlen(in) - 12, "/postresults", 12)) { m = sprintf(buf, "Form results: '%s'
" "", pss->post_string); diff --git a/lwsws/main.c b/lwsws/main.c index 2a7579fc..fc007874 100644 --- a/lwsws/main.c +++ b/lwsws/main.c @@ -62,7 +62,7 @@ static struct lws_protocols protocols[] = { sizeof (struct per_session_data__http), /* per_session_data_size */ 0, /* max frame size / rx buffer */ }, - { } + { NULL, NULL, 0, 0 } }; void sighandler(int sig) diff --git a/plugins/protocol_lws_server_status.c b/plugins/protocol_lws_server_status.c index b41a719a..e2e27e71 100644 --- a/plugins/protocol_lws_server_status.c +++ b/plugins/protocol_lws_server_status.c @@ -39,7 +39,7 @@ struct per_session_data__server_status { int pos; }; -static const struct lws_protocols protocols[]; +static const struct lws_protocols protocols[1]; static void uv_timeout_cb_server_status(uv_timer_t *w diff --git a/plugins/protocol_lws_status.c b/plugins/protocol_lws_status.c index 38281b76..29e1d65f 100644 --- a/plugins/protocol_lws_status.c +++ b/plugins/protocol_lws_status.c @@ -20,6 +20,10 @@ #include "../lib/libwebsockets.h" #include #include +#ifdef WIN32 +#include +#endif + struct per_session_data__lws_status { struct per_session_data__lws_status *list; diff --git a/test-server/test-server-v2.0.c b/test-server/test-server-v2.0.c index debe72ba..56afca58 100644 --- a/test-server/test-server-v2.0.c +++ b/test-server/test-server-v2.0.c @@ -20,7 +20,9 @@ #include #include +#ifndef WIN32 #include +#endif int debug_level = 7; struct lws_context *context;