Move tor_git_revision into a new module.

At first, we put the tor_git_revision constant in tor_main.c, so
that we wouldn't have to recompile config.o every time the git
revision changed.  But putting it there had unintended side effect
of forcing every program that wanted to link libor.a (including
test, test-slow, the fuzzers, the benchmarks, etc) to declare their
own tor_git_revision instance.

That's not very nice, especially since we want to start supporting
others who want to link against Tor (see 23846).

So, create a new git_revision.c file that only contains this
constant, and remove the duplicated boilerplate from everywhere
else.

Part of implementing ticket 23845.
This commit is contained in:
Nick Mathewson
2017-10-18 13:49:35 -04:00
parent b9b5f9a1a5
commit 72b5e4a2db
9 changed files with 36 additions and 28 deletions
+4
View File
@@ -0,0 +1,4 @@
o Code simplification and refactoring:
- The tor_git_revision[] constant no longer needs to be redeclared
by everything that links against the rest of Tor. Done as part
of ticket 23845, to simplify our external API.