mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-16 14:58:25 +00:00
stasis: Fix ABI between DEVMODE and non-DEVMODE.
Create compatibility stubs for maximum ABI compatibility. ASTERISK-28212 #close Change-Id: I872c04842ab6b61e9dd6d37e4166bc619aa20626
This commit is contained in:
@@ -206,14 +206,9 @@ static void router_dispatch(void *data,
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef AST_DEVMODE
|
||||
static struct stasis_message_router *stasis_message_router_create_internal(
|
||||
struct stasis_topic *topic, int use_thread_pool, const char *file, int lineno,
|
||||
const char *func)
|
||||
#else
|
||||
static struct stasis_message_router *stasis_message_router_create_internal(
|
||||
struct stasis_topic *topic, int use_thread_pool)
|
||||
#endif
|
||||
{
|
||||
int res;
|
||||
struct stasis_message_router *router;
|
||||
@@ -232,19 +227,11 @@ static struct stasis_message_router *stasis_message_router_create_internal(
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#ifdef AST_DEVMODE
|
||||
if (use_thread_pool) {
|
||||
router->subscription = __stasis_subscribe_pool(topic, router_dispatch, router, file, lineno, func);
|
||||
} else {
|
||||
router->subscription = __stasis_subscribe(topic, router_dispatch, router, file, lineno, func);
|
||||
}
|
||||
#else
|
||||
if (use_thread_pool) {
|
||||
router->subscription = stasis_subscribe_pool(topic, router_dispatch, router);
|
||||
} else {
|
||||
router->subscription = stasis_subscribe(topic, router_dispatch, router);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (!router->subscription) {
|
||||
ao2_ref(router, -1);
|
||||
@@ -258,33 +245,17 @@ static struct stasis_message_router *stasis_message_router_create_internal(
|
||||
return router;
|
||||
}
|
||||
|
||||
#ifdef AST_DEVMODE
|
||||
struct stasis_message_router *__stasis_message_router_create(
|
||||
struct stasis_topic *topic, const char *file, int lineno, const char *func)
|
||||
{
|
||||
return stasis_message_router_create_internal(topic, 0, file, lineno, func);
|
||||
}
|
||||
#else
|
||||
struct stasis_message_router *stasis_message_router_create(
|
||||
struct stasis_topic *topic)
|
||||
{
|
||||
return stasis_message_router_create_internal(topic, 0);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef AST_DEVMODE
|
||||
struct stasis_message_router *__stasis_message_router_create_pool(
|
||||
struct stasis_topic *topic, const char *file, int lineno, const char *func)
|
||||
{
|
||||
return stasis_message_router_create_internal(topic, 1, file, lineno, func);
|
||||
}
|
||||
#else
|
||||
struct stasis_message_router *stasis_message_router_create_pool(
|
||||
struct stasis_topic *topic)
|
||||
{
|
||||
return stasis_message_router_create_internal(topic, 1);
|
||||
}
|
||||
#endif
|
||||
|
||||
void stasis_message_router_unsubscribe(struct stasis_message_router *router)
|
||||
{
|
||||
@@ -442,3 +413,23 @@ void stasis_message_router_accept_formatters(struct stasis_message_router *route
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef AST_DEVMODE
|
||||
#undef stasis_message_router_create
|
||||
struct stasis_message_router *stasis_message_router_create(
|
||||
struct stasis_topic *topic);
|
||||
#undef stasis_message_router_create_pool
|
||||
struct stasis_message_router *stasis_message_router_create_pool(
|
||||
struct stasis_topic *topic);
|
||||
#endif
|
||||
struct stasis_message_router *stasis_message_router_create(
|
||||
struct stasis_topic *topic)
|
||||
{
|
||||
return stasis_message_router_create_internal(topic, 0, __FILE__, __LINE__, __PRETTY_FUNCTION__);
|
||||
}
|
||||
|
||||
struct stasis_message_router *stasis_message_router_create_pool(
|
||||
struct stasis_topic *topic)
|
||||
{
|
||||
return stasis_message_router_create_internal(topic, 1, __FILE__, __LINE__, __PRETTY_FUNCTION__);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user