summaryrefslogtreecommitdiff
path: root/src/basic/missing.h
diff options
context:
space:
mode:
authorShawn Landden <shawn@churchofgit.com>2015-12-13 14:26:43 -0800
committerDaniel Mack <daniel@zonque.org>2016-01-27 14:10:02 +0100
commitc932fb71cc90461b88ecdffe47c071d001d78fb4 (patch)
tree7cf4835039617e8840434e28dec2ea0fb37b71ca /src/basic/missing.h
parent9766c16bd08bd6714064ee950798a6db0874b048 (diff)
utf8.[ch] et al: use char32_t and char16_t instead of int, int32_t, int16_t
rework C11 utf8.[ch] to use char32_t instead of uint32_t when referring to unicode chars, to make things more expressive. [ @zonque: * rebased to current master * use AC_CHECK_DECLS to detect availibility of char{16,32}_t * make utf8_encoded_to_unichar() return int ]
Diffstat (limited to 'src/basic/missing.h')
-rw-r--r--src/basic/missing.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/basic/missing.h b/src/basic/missing.h
index 6ed2133ed1..48ca04a8a1 100644
--- a/src/basic/missing.h
+++ b/src/basic/missing.h
@@ -36,6 +36,7 @@
#include <stdlib.h>
#include <sys/resource.h>
#include <sys/syscall.h>
+#include <uchar.h>
#include <unistd.h>
#ifdef HAVE_AUDIT
@@ -1159,4 +1160,13 @@ static inline key_serial_t request_key(const char *type, const char *description
#ifndef IF_OPER_UP
#define IF_OPER_UP 6
+
+#ifndef HAVE_DECL_CHAR32_T
+#define char32_t uint32_t
+#endif
+
+#ifndef HAVE_DECL_CHAR16_T
+#define char16_t uint16_t
+#endif
+
#endif