From patchwork Mon Nov 24 11:08:26 2008 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sven Eckelmann X-Patchwork-Id: 5366 Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by open-mesh.net (8.13.4/8.13.4/Debian-3sarge3) with SMTP id mAOBE9LF027831 for ; Mon, 24 Nov 2008 12:14:10 +0100 Received: (qmail invoked by alias); 24 Nov 2008 11:08:29 -0000 Received: from unknown (EHLO localhost) [89.246.196.192] by mail.gmx.net (mp014) with SMTP; 24 Nov 2008 12:08:29 +0100 X-Authenticated: #15668376 X-Provags-ID: V01U2FsdGVkX19GCTp1sJpGFVbPKtGnZmi6MD9wr3ufvmITgrdMJI qfvlqZbbiwvL79 From: Sven Eckelmann To: b.a.t.m.a.n@open-mesh.net Date: Mon, 24 Nov 2008 12:08:26 +0100 Message-Id: <1227524906-12097-1-git-send-email-sven.eckelmann@gmx.de> X-Mailer: git-send-email 1.6.0.4 X-Y-GMX-Trusted: 0 X-FuHaFi: 0.64 Subject: [B.A.T.M.A.N.] [PATCH] Don't create different definitions of variables from header X-BeenThere: b.a.t.m.a.n@open-mesh.net X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The list for a Better Approach To Mobile Ad-hoc Networking List-Id: The list for a Better Approach To Mobile Ad-hoc Networking List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Nov 2008 11:14:10 -0000 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 --- 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;