Avoid duplicate declarations of bsdindent's global variables.
authorTom Lane <tgl@sss.pgh.pa.us>
Tue, 30 Jun 2020 01:19:16 +0000 (21:19 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Tue, 30 Jun 2020 01:19:16 +0000 (21:19 -0400)
commitacb2f0a7f3689805b954ea19a927b5021fc69409
treed54349d2d75d9036e61df6e35969914c33f46eb8
parente6a167ea4a864af35c61421af8ea4b0cbca39612
Avoid duplicate declarations of bsdindent's global variables.

Arrange for all the variable declarations in indent_globs.h to look
like "extern" declarations to every .c file except indent.c.
This prevents linker failure due to duplicated global variables when
the code is built with -fno-common, which is soon to be gcc's default.

The method of temporarily #define'ing "extern" to empty is a hack,
no doubt, but it avoids requiring a duplicate set of variable
definitions, so it seemed like the best way.

Discussion: https://postgr.es/m/20200629165051.xlfqhstajf6ynxyv@alap3.anarazel.de
indent.c
indent_globs.h