Skip to content

Commit 9881326

Browse files
committed
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
2 parents f22d4ac + 9d3b331 commit 9881326

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

sane-ctype.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
#ifndef SANE_CTYPE_H
22
#define SANE_CTYPE_H
33

4+
/*
5+
* Explicitly include <ctype.h> so that its header guards kick in from here on.
6+
* This ensures that the file won't get included after "sane-ctype.h", as that
7+
* would otherwise lead to a compiler error because the function declarations
8+
* for `int isascii(int c)` et al would be mangled by our macros with the same
9+
* name.
10+
*/
11+
#include <ctype.h>
12+
413
/* Sane ctype - no locale, and works with signed chars */
514
#undef isascii
615
#undef isspace

0 commit comments

Comments
 (0)