about summary refs log tree commit diff
path: root/cgit.h
diff options
context:
space:
mode:
authorJohn Keeping <john@keeping.me.uk>2015-08-13 12:14:19 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2015-08-13 15:38:35 +0200
commit7105a78b17b118866aee77735e26cffcd1fd08fd (patch)
treed41495b5e039be7cd5943e206b4f1a173542c07c /cgit.h
parentcgit.h: move stdbool.h from ui-shared.h (diff)
downloadcgit-pink-7105a78b17b118866aee77735e26cffcd1fd08fd.tar.gz
cgit-pink-7105a78b17b118866aee77735e26cffcd1fd08fd.zip
ui-tree: use "sane" isgraph()
Git's git-compat-util.h defines a "sane ctype" that does not use locale
information and works with signed chars, but it does not include
isgraph() so we have included ctype.h ourselves.

However, this means we have to include a system header before
git-compat-util.h which may lead to the system defining some macros
(e.g. _FILE_OFFSET_BITS on Solaris) before git-compat-util.h redefines
them with a different value.  We cannot include ctype.h after
git-compat-util.h because we have defined many of its functions as
macros which causes a stream of compilation errors.

Defining our own "sane" isgraph() using Git's sane isprint() and
isspace() avoids all of these problems.

Signed-off-by: John Keeping <john@keeping.me.uk>
Diffstat (limited to 'cgit.h')
-rw-r--r--cgit.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/cgit.h b/cgit.h
index 508179a..f327627 100644
--- a/cgit.h
+++ b/cgit.h
@@ -25,6 +25,9 @@
 #include <notes.h>
 #include <graph.h>
 
+/* Add isgraph(x) to Git's sane ctype support (see git-compat-util.h) */
+#undef isgraph
+#define isgraph(x) (isprint((x)) && !isspace((x)))
 
 /*
  * Dateformats used on misc. pages
/span>Set X key repeat rateJune McEnroe 2021-02-07Bump font size to 12June McEnroe 2021-02-07Fully configure and rebind cwmJune McEnroe 2021-02-07Add BintiJune McEnroe 2021-02-07Finish configuring xtermJune McEnroe 2021-02-06Enable tapping, reverse scroll, set scaling in wsconsctlJune McEnroe 2021-02-06Set root window to black on purple snowJune McEnroe 2021-02-06Add xmodmap configurationJune McEnroe 2021-02-06Add initial OpenBSD X configurationJune McEnroe 2021-02-06Add xterm output to schemeJune McEnroe