summaryrefslogtreecommitdiff
path: root/package/heirloom-cpio/src/blank.h
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@openadk.org>2014-03-30 17:09:11 +0200
committerWaldemar Brodkorb <wbx@openadk.org>2014-03-30 17:09:11 +0200
commit208c1a556654a5cc3a3fd5fcc500f70261fb084b (patch)
tree1a1a0112594a7939739b32e48bf370618f8eb812 /package/heirloom-cpio/src/blank.h
parent113a0add9081f04a0dc1f11ae47eb11fbe6b5512 (diff)
parent44422107fcae7591bc9ee0ca54fa580160345e4a (diff)
Merge branch 'master' of git+ssh://openadk.org/git/openadk
Diffstat (limited to 'package/heirloom-cpio/src/blank.h')
-rw-r--r--package/heirloom-cpio/src/blank.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/package/heirloom-cpio/src/blank.h b/package/heirloom-cpio/src/blank.h
new file mode 100644
index 000000000..1ab3d57b8
--- /dev/null
+++ b/package/heirloom-cpio/src/blank.h
@@ -0,0 +1,38 @@
+/*
+ * isblank() and iswblank() are not available with many pre-XSH6
+ * systems. Check whether isblank was defined, and assume it is
+ * not available if not.
+ */
+/* Sccsid @(#)blank.h 1.3 (gritter) 5/1/04 */
+
+#ifndef __dietlibc__
+#ifndef LIBCOMMON_BLANK_H
+#define LIBCOMMON_BLANK_H 1
+
+#include <ctype.h>
+#include <wctype.h>
+
+#ifndef isblank
+
+static
+#ifdef __GNUC__
+__inline__
+#endif /* __GNUC__ */
+int
+my_isblank(int c)
+{
+ return c == ' ' || c == '\t';
+}
+#define isblank(c) my_isblank(c)
+
+static int
+my_iswblank(wint_t c)
+{
+ return c == L' ' || c == L'\t';
+}
+#undef iswblank
+#define iswblank(c) my_iswblank(c)
+
+#endif /* !isblank */
+#endif /* !LIBCOMMON_BLANK_H */
+#endif /* !__dietlibc__ */