From 4ea88db58ca2c7d488996003b4a51cc3f3cf7808 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Wed, 13 Apr 2011 23:19:22 +0200 Subject: [PATCH] add a __init define for constructors --- device.c | 4 +--- netifd.h | 2 ++ 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/device.c b/device.c index 31fc467..ef70685 100644 --- a/device.c +++ b/device.c @@ -3,14 +3,12 @@ #include #include -#include - #include "netifd.h" #include "system.h" static struct avl_tree devices; -static void API_CTOR dev_init(void) +static void __init dev_init(void) { avl_init(&devices, avl_strcmp, false, NULL); } diff --git a/netifd.h b/netifd.h index 771bcea..b70b73c 100644 --- a/netifd.h +++ b/netifd.h @@ -19,6 +19,8 @@ #define DPRINTF(...) do {} while(0) #endif +#define __init __attribute__((constructor)) + struct device; struct interface; -- 2.30.2