Don't create different definitions of variables from header
Commit Message
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(-)
@@ -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;
@@ -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;