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
maint
Junio C Hamano 2025-07-23 15:45:16 -07:00
commit 98813265b3
1 changed files with 9 additions and 0 deletions

View File

@ -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