]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
rephist: fix an undeclared type compilation error
authorteor <teor@torproject.org>
Tue, 16 Apr 2019 05:39:45 +0000 (15:39 +1000)
committerteor <teor@torproject.org>
Tue, 16 Apr 2019 05:39:45 +0000 (15:39 +1000)
In 0.3.4 and later, we declare write_array as:
extern struct bw_array_t *write_array;
...
typedef struct bw_array_t bw_array_t;

But in 0.2.9, we declare write_array as:
typedef struct bw_array_t bw_array_t;
extern bw_array_t *write_array;

And then again in rephist.c:
typedef struct bw_array_t bw_array_t;

So some compilers fail with a duplicate declaration error.

We backport 684b396ce5, which removes the duplicate declaration.
And this commit deals with the undeclared type error.

Backports a single line from merge commit 813019cc57.

Fixes bug 30184; not in any released version of Tor.

src/or/rephist.h

index d2f6c66df73c2126d0e632cdb33966c909db3aa3..303cd74f7a65eda2e5ad170ecafd8cbe784cb4ef 100644 (file)
@@ -117,7 +117,7 @@ extern uint32_t rephist_total_num;
 #ifdef TOR_UNIT_TESTS
 extern int onion_handshakes_requested[MAX_ONION_HANDSHAKE_TYPE+1];
 extern int onion_handshakes_assigned[MAX_ONION_HANDSHAKE_TYPE+1];
-extern bw_array_t *write_array;
+extern struct bw_array_t *write_array;
 #endif
 
 #endif