diff options
author | Jeff King <peff@peff.net> | 2022-12-02 12:05:38 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-12-05 04:15:37 +0100 |
commit | e1a95b78d8a26762ea04332de8b7c3878da51522 (patch) | |
tree | fd07e0caca7762c9a5cc05db36094aa1db58e666 /t/t7007-show.sh | |
parent | git-compat-util: avoid redefining system function names (diff) | |
download | git-e1a95b78d8a26762ea04332de8b7c3878da51522.tar.xz git-e1a95b78d8a26762ea04332de8b7c3878da51522.zip |
git-compat-util: undefine system names before redeclaring them
When we define a macro to point a system function (e.g., flockfile) to
our custom wrapper, we should make sure that the system did not already
define it as a macro. This is rarely a problem, but can cause
compilation failures if both of these are true:
- we decide to define our own wrapper even though the system provides
the function; we know this happens at least with uclibc, which may
declare flockfile, etc, without _POSIX_THREAD_SAFE_FUNCTIONS
- the system version is declared as a macro; we know this happens at
least with uclibc's version of getc_unlocked()
So just handling getc_unlocked() would be sufficient to deal with the
real-world case we've seen. But since it's easy to do, we may as well be
defensive about the other macro wrappers added in the previous patch.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t7007-show.sh')
0 files changed, 0 insertions, 0 deletions