libubus: replace __init with __constructor

__init has a naming collision with C++ and prevents ubus_common.h
from being included. Instead, use __constructor as defined from
libubox.

Signed-off-by: Zefir Kurtisi <zefir.kurtisi@neratec.com>
This commit is contained in:
Zefir Kurtisi 2014-09-17 12:30:49 +02:00 committed by Felix Fietkau
parent e52db46c9c
commit 4d1cdc5527
3 changed files with 2 additions and 4 deletions

View file

@ -21,6 +21,4 @@
#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
#endif
#define __init __attribute__((constructor))
#endif

View file

@ -219,7 +219,7 @@ void ubusd_free_object(struct ubus_object *obj)
free(obj);
}
static void __init ubusd_obj_init(void)
static void __constructor ubusd_obj_init(void)
{
ubus_init_id_tree(&objects);
ubus_init_id_tree(&obj_types);

View file

@ -506,7 +506,7 @@ void ubus_notify_unsubscribe(struct ubus_subscription *s)
ubus_unsubscribe(s);
}
static void __init ubusd_proto_init(void)
static void __constructor ubusd_proto_init(void)
{
ubus_init_id_tree(&clients);