diff options
author | Junio C Hamano <gitster@pobox.com> | 2025-07-23 15:45:16 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2025-07-23 15:45:16 -0700 |
commit | 98813265b360ebc59371d7d32efa47eb24adda15 (patch) | |
tree | 958d259483ba6f1327caf46b4c63f5e81da0f99e | |
parent | f22d4ac4fd50b55c88142dfd15a361680cf3fb40 (diff) | |
parent | 9d3b33125f01c64003e0aa86056a6d68a428e0f0 (diff) |
Merge branch 'ps/sane-ctype-workaround'
Our <sane-ctype.h> header file relied on that the system-supplied
<ctype.h> header is not later included, which would override our
macro definitions, but "amazon linux" broke this assumption. Fix
this by preemptively including <ctype.h> near the beginning of
<sane-ctype.h> ourselves.
* ps/sane-ctype-workaround:
sane-ctype: fix compiler error on Amazon Linux 2
-rw-r--r-- | sane-ctype.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/sane-ctype.h b/sane-ctype.h index cbea1b299b..4f476c4381 100644 --- a/sane-ctype.h +++ b/sane-ctype.h @@ -1,6 +1,15 @@ #ifndef SANE_CTYPE_H #define SANE_CTYPE_H +/* + * Explicitly include <ctype.h> so that its header guards kick in from here on. + * This ensures that the file won't get included after "sane-ctype.h", as that + * would otherwise lead to a compiler error because the function declarations + * for `int isascii(int c)` et al would be mangled by our macros with the same + * name. + */ +#include <ctype.h> + /* Sane ctype - no locale, and works with signed chars */ #undef isascii #undef isspace |