From: Zefir Kurtisi Date: Wed, 17 Sep 2014 10:30:49 +0000 (+0200) Subject: libubus: replace __init with __constructor X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fubus.git;a=commitdiff_plain;h=4d1cdc55274aac9d032e3ae4bbf0ab72336ba9ac 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 --- diff --git a/ubus_common.h b/ubus_common.h index 18cb664..4bb9927 100644 --- a/ubus_common.h +++ b/ubus_common.h @@ -21,6 +21,4 @@ #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) #endif -#define __init __attribute__((constructor)) - #endif diff --git a/ubusd_obj.c b/ubusd_obj.c index 3859c45..8923821 100644 --- a/ubusd_obj.c +++ b/ubusd_obj.c @@ -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); diff --git a/ubusd_proto.c b/ubusd_proto.c index 130e9a8..6b068eb 100644 --- a/ubusd_proto.c +++ b/ubusd_proto.c @@ -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);