mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-09 00:00:04 +01:00
event: blow error if runtime context options want eventlib we dont have
https://github.com/warmcat/libwebsockets/issues/3186
This commit is contained in:
parent
2ca5d8605b
commit
8fc7596fec
1 changed files with 30 additions and 0 deletions
|
@ -542,6 +542,11 @@ lws_create_context(const struct lws_context_creation_info *info)
|
|||
fatal_exit_defer = !!info->foreign_loops;
|
||||
us_wait_resolution = 0;
|
||||
}
|
||||
#else
|
||||
if (lws_check_opt(info->options, LWS_SERVER_OPTION_LIBUV)) {
|
||||
lwsl_cx_err(context, "Application wants libuv, but lws not built with it");
|
||||
goto bail;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(LWS_WITH_LIBEVENT)
|
||||
|
@ -550,6 +555,11 @@ lws_create_context(const struct lws_context_creation_info *info)
|
|||
plev = &evlib_event;
|
||||
us_wait_resolution = 0;
|
||||
}
|
||||
#else
|
||||
if (lws_check_opt(info->options, LWS_SERVER_OPTION_LIBEVENT)) {
|
||||
lwsl_cx_err(context, "Application wants libevent, but lws not built with it");
|
||||
goto bail;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(LWS_WITH_GLIB)
|
||||
|
@ -558,6 +568,11 @@ lws_create_context(const struct lws_context_creation_info *info)
|
|||
plev = &evlib_glib;
|
||||
us_wait_resolution = 0;
|
||||
}
|
||||
#else
|
||||
if (lws_check_opt(info->options, LWS_SERVER_OPTION_GLIB)) {
|
||||
lwsl_cx_err(context, "Application wants glib, but lws not built with it");
|
||||
goto bail;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(LWS_WITH_LIBEV)
|
||||
|
@ -566,6 +581,11 @@ lws_create_context(const struct lws_context_creation_info *info)
|
|||
plev = &evlib_ev;
|
||||
us_wait_resolution = 0;
|
||||
}
|
||||
#else
|
||||
if (lws_check_opt(info->options, LWS_SERVER_OPTION_LIBEV)) {
|
||||
lwsl_cx_err(context, "Application wants libev, but lws not built with it");
|
||||
goto bail;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(LWS_WITH_SDEVENT)
|
||||
|
@ -574,6 +594,11 @@ lws_create_context(const struct lws_context_creation_info *info)
|
|||
plev = &evlib_sd;
|
||||
us_wait_resolution = 0;
|
||||
}
|
||||
#else
|
||||
if (lws_check_opt(info->options, LWS_SERVER_OPTION_SDEVENT)) {
|
||||
lwsl_cx_err(context, "Application wants sdevent, but lws not built with it");
|
||||
goto bail;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(LWS_WITH_ULOOP)
|
||||
|
@ -582,6 +607,11 @@ lws_create_context(const struct lws_context_creation_info *info)
|
|||
plev = &evlib_uloop;
|
||||
us_wait_resolution = 0;
|
||||
}
|
||||
#else
|
||||
if (lws_check_opt(info->options, LWS_SERVER_OPTION_ULOOP)) {
|
||||
lwsl_cx_err(context, "Application wants uloop, but lws not built with it");
|
||||
goto bail;
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* with event libs */
|
||||
|
|
Loading…
Add table
Reference in a new issue