diff options
| author | Junio C Hamano <gitster@pobox.com> | 2021-12-08 17:39:39 -0800 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2021-12-08 17:45:16 -0800 |
| commit | deefc2d9f6a24a5787598fa70ddfa4a91601f202 (patch) | |
| tree | ffea5ad498fe2029975112b6735e10ba54cfae9a /diff.c | |
| parent | Git 2.34.1 (diff) | |
| download | git-deefc2d9f6a24a5787598fa70ddfa4a91601f202.tar.gz git-deefc2d9f6a24a5787598fa70ddfa4a91601f202.zip | |
flex-array: simplify compiler-specific workaround
We use "type array[];" syntax for the flex-array member at the end
of a struct under C99 or later, except when we are building with
older SUNPRO_C compilers. As we find more vendor compilers that
claim to grok C99 but not understand the flex-array syntax, the
existing "If we are using C99, but not with these compilers..."
conditional will keep growing.
Make it more manageable by listing vendor-specific exceptions
earlier, with the expectation that new exceptions will not be
combined into existing ones to make the condition longer, and
instead will be implemented as a new "#elif" in the cascade of
similar to old SUNPRO_C, we can just add a single line
#elif defined(_MSC_VER)
immediately before "#elif defined(__GNUC__)" to cause us to fallback
to the safer but a bit wasteful version.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'diff.c')
0 files changed, 0 insertions, 0 deletions
