summaryrefslogtreecommitdiff
path: root/trailer.c
diff options
context:
space:
mode:
authorJohannes Sixt <j6t@kdbg.org>2016-08-09 14:17:56 (GMT)
committerJunio C Hamano <gitster@pobox.com>2016-08-09 17:20:06 (GMT)
commitaf920e369778a4cc42519ef523131d29451bf79b (patch)
treebf6fe742e5eccf45138f18f6dfbbac2665d91a9e /trailer.c
parentdc29ddebb969af489cdfd5dbbf424710973ef62f (diff)
downloadgit-af920e369778a4cc42519ef523131d29451bf79b.zip
git-af920e369778a4cc42519ef523131d29451bf79b.tar.gz
git-af920e369778a4cc42519ef523131d29451bf79b.tar.bz2
commit-slab.h: avoid duplicated global static variables
The gigantic define_commit_slab() macro repeats the definition of a static variable that occurs earlier in the macro text. The purpose of the repeated definition at the end of the macro is that it takes the semicolon that occurs where the macro is used. We cannot just remove the first definition of the variable because it is referenced elsewhere in the macro text, and defining the macro later would produce undefined identifier errors. We cannot have a "forward" declaration, either. (This works only with "extern" global variables.) The solution is to use a declaration of a struct that is already defined earlier. This language construct can serve the same purpose as the duplicated static variable definition, but without the confusion. Signed-off-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'trailer.c')
0 files changed, 0 insertions, 0 deletions