b.a.t.m.a.n.lists.open-mesh.org archive mirror
 help / color / mirror / Atom feed
From: Sven Eckelmann <sven.eckelmann@gmx.de>
To: b.a.t.m.a.n@open-mesh.net
Subject: [B.A.T.M.A.N.] [PATCH] Don't create different definitions of variables from header
Date: Mon, 24 Nov 2008 12:08:26 +0100	[thread overview]
Message-ID: <1227524906-12097-1-git-send-email-sven.eckelmann@gmx.de> (raw)

Declaration of variables in header files must be marked extern or they will
create new definition in all files which include it. This could create
collisions on different architectures or by using different linkers.
A different effect is the misfeature of the program when different files access
these variable and think they would use the same variable in memory.

Signed-off-by: Sven Eckelmann <sven.eckelmann@gmx.de>
---
 batman-adv-userspace/batman-adv.h |    2 +-
 batman-experimental/batman.h      |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/batman-adv-userspace/batman-adv.h b/batman-adv-userspace/batman-adv.h
index 6c0aed3..33c5412 100644
--- a/batman-adv-userspace/batman-adv.h
+++ b/batman-adv-userspace/batman-adv.h
@@ -134,7 +134,7 @@ extern uint32_t pref_gateway;
 extern unsigned char *hna_buff;
 
 extern struct gw_node *curr_gateway;
-pthread_t curr_gateway_thread_id;
+extern pthread_t curr_gateway_thread_id;
 
 extern uint8_t found_ifs;
 extern int32_t receive_max_sock;
diff --git a/batman-experimental/batman.h b/batman-experimental/batman.h
index 8bcb48d..5fe64f6 100644
--- a/batman-experimental/batman.h
+++ b/batman-experimental/batman.h
@@ -568,7 +568,7 @@ extern struct list_head_first notun_list;
 
 extern struct unix_if unix_if;
 
-struct vis_if *vis_if;
+extern struct vis_if *vis_if;
 
 extern pthread_t gw_thread_id;
 
-- 
1.6.0.4


                 reply	other threads:[~2008-11-24 11:08 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1227524906-12097-1-git-send-email-sven.eckelmann@gmx.de \
    --to=sven.eckelmann@gmx.de \
    --cc=b.a.t.m.a.n@open-mesh.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).