From 028145ac10b39c8e60ac8c100acc5d7825c0b748 Mon Sep 17 00:00:00 2001 From: Kalle Olavi Niemitalo Date: Mon, 9 Jul 2007 13:44:57 +0300 Subject: [PATCH] Define BITTORRENT_NULL_ID in common.c; declare extern in common.h. This change avoids linker warnings when building with Debian tcc 0.9.23-4 + patch from Debian bug 418360: [LD] src/protocol/bittorrent/lib.o bittorrent.o: 'BITTORRENT_NULL_ID' defined twice common.o: 'BITTORRENT_NULL_ID' defined twice connection.o: 'BITTORRENT_NULL_ID' defined twice dialogs.o: 'BITTORRENT_NULL_ID' defined twice peerconnect.o: 'BITTORRENT_NULL_ID' defined twice peerwire.o: 'BITTORRENT_NULL_ID' defined twice piececache.o: 'BITTORRENT_NULL_ID' defined twice tracker.o: 'BITTORRENT_NULL_ID' defined twice --- src/protocol/bittorrent/common.c | 2 ++ src/protocol/bittorrent/common.h | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/protocol/bittorrent/common.c b/src/protocol/bittorrent/common.c index 11d8555d..ddefa288 100644 --- a/src/protocol/bittorrent/common.c +++ b/src/protocol/bittorrent/common.c @@ -21,6 +21,8 @@ #include "util/string.h" #include "util/snprintf.h" +const bittorrent_id_T BITTORRENT_NULL_ID; + /* Debug function which returns printable peer ID. */ unsigned char * get_peer_id(bittorrent_id_T peer_id) diff --git a/src/protocol/bittorrent/common.h b/src/protocol/bittorrent/common.h index 87915c6c..1108efe3 100644 --- a/src/protocol/bittorrent/common.h +++ b/src/protocol/bittorrent/common.h @@ -45,7 +45,7 @@ struct terminal; typedef sha1_digest_bin_T bittorrent_id_T; /* Special peer ID used for determining whether an ID has been set. */ -const bittorrent_id_T BITTORRENT_NULL_ID; +extern const bittorrent_id_T BITTORRENT_NULL_ID; #define bittorrent_id_is_empty(id) \ (!memcmp(id, BITTORRENT_NULL_ID, sizeof(bittorrent_id_T)))