libubus: replace __init with __constructor
authorZefir Kurtisi <zefir.kurtisi@neratec.com>
Wed, 17 Sep 2014 10:30:49 +0000 (12:30 +0200)
committerFelix Fietkau <nbd@openwrt.org>
Wed, 17 Sep 2014 11:29:24 +0000 (13:29 +0200)
__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>
ubus_common.h
ubusd_obj.c
ubusd_proto.c

index 18cb664..4bb9927 100644 (file)
@@ -21,6 +21,4 @@
 #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
 #endif
 
 #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
 #endif
 
-#define __init __attribute__((constructor))
-
 #endif
 #endif
index 3859c45..8923821 100644 (file)
@@ -219,7 +219,7 @@ void ubusd_free_object(struct ubus_object *obj)
        free(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);
 {
        ubus_init_id_tree(&objects);
        ubus_init_id_tree(&obj_types);
index 130e9a8..6b068eb 100644 (file)
@@ -506,7 +506,7 @@ void ubus_notify_unsubscribe(struct ubus_subscription *s)
        ubus_unsubscribe(s);
 }
 
        ubus_unsubscribe(s);
 }
 
-static void __init ubusd_proto_init(void)
+static void __constructor ubusd_proto_init(void)
 {
        ubus_init_id_tree(&clients);
 
 {
        ubus_init_id_tree(&clients);