src: avoid use of _init

Xtables-addons's extensions will always be built as modules, so it is
safe to use __attribute__((constructor)).
This commit is contained in:
Jan Engelhardt
2008-11-20 20:00:26 +01:00
parent a8f60d0d4b
commit aab8dd360f
16 changed files with 17 additions and 21 deletions

View File

@@ -106,8 +106,7 @@ static struct xtables_target chaos_tg_reg = {
.extra_opts = chaos_tg_opts,
};
void _init(void);
void _init(void)
static __attribute__((constructor)) void chaos_tg_ldr(void)
{
xtables_register_target(&chaos_tg_reg);
}

View File

@@ -41,8 +41,7 @@ static struct xtables_target delude_tg_reg = {
.final_check = delude_tg_check,
};
void _init(void);
void _init(void)
static __attribute__((constructor)) void delude_tg_ldr(void)
{
xtables_register_target(&delude_tg_reg);
}

View File

@@ -95,7 +95,7 @@ static struct xtables_target dhcpaddr_tg_reg = {
.extra_opts = dhcpaddr_tg_opts,
};
static void _init(void)
static __attribute__((constructor)) void dhcpaddr_tg_ldr(void)
{
xtables_register_target(&dhcpaddr_tg_reg);
}

View File

@@ -37,7 +37,7 @@ static struct xtables_target echo_tg_reg = {
.final_check = echo_tg_check,
};
static void _init(void)
static __attribute__((constructor)) void echo_tg_ldr(void)
{
xtables_register_target(&echo_tg_reg);
}

View File

@@ -175,7 +175,7 @@ static struct xtables_target ipmark_tg6_reg = {
.extra_opts = ipmark_tg_opts,
};
static void _init(void)
static __attribute__((constructor)) void ipmark_tg_ldr(void)
{
xtables_register_target(&ipmark_tg4_reg);
xtables_register_target(&ipmark_tg6_reg);

View File

@@ -111,8 +111,7 @@ static struct xtables_target logmark_tg_reg = {
.extra_opts = logmark_tg_opts,
};
void _init(void);
void _init(void)
static __attribute__((constructor)) void logmark_tg_ldr(void)
{
xtables_register_target(&logmark_tg_reg);
}

View File

@@ -43,7 +43,7 @@ static struct xtables_target sysrq_tg6_reg = {
.final_check = sysrq_tg_check,
};
static void _init(void)
static __attribute__((constructor)) void sysrq_tg_ldr(void)
{
xtables_register_target(&sysrq_tg4_reg);
xtables_register_target(&sysrq_tg6_reg);

View File

@@ -32,7 +32,7 @@ static struct xtables_target tarpit_tg_reg = {
.final_check = tarpit_tg_check,
};
static void _init(void)
static __attribute__((constructor)) void tarpit_tg_ldr(void)
{
xtables_register_target(&tarpit_tg_reg);
}

View File

@@ -108,7 +108,7 @@ static struct xtables_target tee_tg_reg = {
.extra_opts = tee_tg_opts,
};
static void _init(void)
static __attribute__((constructor)) void tee_tg_ldr(void)
{
xtables_register_target(&tee_tg_reg);
}

View File

@@ -92,7 +92,7 @@ static struct xtables_match condition_mt_reg = {
.extra_opts = condition_opts,
};
static void _init(void)
static __attribute__((constructor)) void condition_mt_ldr(void)
{
xtables_register_match(&condition_mt_reg);
}

View File

@@ -96,7 +96,7 @@ static struct xtables_match dhcpaddr_mt_reg = {
.extra_opts = dhcpaddr_mt_opts,
};
static void _init(void)
static __attribute__((constructor)) void dhcpaddr_mt_ldr(void)
{
xtables_register_match(&dhcpaddr_mt_reg);
}

View File

@@ -112,7 +112,7 @@ static struct xtables_match fuzzy_mt_reg = {
.extra_opts = fuzzy_mt_opts,
};
static void _init(void)
static __attribute__((constructor)) void fuzzy_mt_ldr(void)
{
xtables_register_match(&fuzzy_mt_reg);
}

View File

@@ -272,7 +272,7 @@ static struct xtables_match geoip_match = {
.extra_opts = geoip_opts,
};
static void _init(void)
static __attribute__((constructor)) void geoip_mt_ldr(void)
{
xtables_register_match(&geoip_match);
}

View File

@@ -242,7 +242,7 @@ static struct xtables_match ipp2p_mt_reg = {
.extra_opts = ipp2p_mt_opts,
};
static void _init(void)
static __attribute__((constructor)) void ipp2p_mt_ldr(void)
{
xtables_register_match(&ipp2p_mt_reg);
}

View File

@@ -116,8 +116,7 @@ static struct xtables_match portscan_mt_reg = {
.extra_opts = portscan_mt_opts,
};
void _init(void);
void _init(void)
static __attribute__((constructor)) void portscan_mt_ldr(void)
{
xtables_register_match(&portscan_mt_reg);
}

View File

@@ -133,7 +133,7 @@ static struct xtables_match quota_mt2_reg = {
.extra_opts = quota_mt2_opts,
};
static void _init(void)
static __attribute__((constructor)) void quota2_mt_ldr(void)
{
xtables_register_match(&quota_mt2_reg);
}