added missing dependencies to fix failing unistr/ tests
[gnulib.git] / lib / wctype.in.h
index 0693014..6782478 100644 (file)
 
 /* The definition of _GL_WARN_ON_USE is copied here.  */
 
-/* Define wint_t.  (Also done in wchar.in.h.)  */
+/* Define wint_t and WEOF.  (Also done in wchar.in.h.)  */
 #if !@HAVE_WINT_T@ && !defined wint_t
 # define wint_t int
 # ifndef WEOF
 #  define WEOF -1
 # endif
+#else
+# ifndef WEOF
+#  define WEOF ((wint_t) -1)
+# endif
 #endif
 
 
 /* FreeBSD 4.4 to 4.11 has <wctype.h> but lacks the functions.
    Linux libc5 has <wctype.h> and the functions but they are broken.
-   Assume all 12 functions are implemented the same way, or not at all.  */
+   Assume all 11 functions (all isw* except iswblank) are implemented the
+   same way, or not at all.  */
 #if ! @HAVE_ISWCNTRL@ || @REPLACE_ISWCNTRL@
 
 /* IRIX 5.3 has macros but no functions, its isw* macros refer to an
@@ -271,7 +276,16 @@ towupper
   return (wc >= 'a' && wc <= 'z' ? wc - 'a' + 'A' : wc);
 }
 
-#endif /* ! HAVE_ISWCNTRL || REPLACE_ISWCNTRL */
+#elif ! @HAVE_ISWBLANK@
+/* Only the iswblank function is missing.  */
+
+static inline int
+iswblank (wint_t wc)
+{
+  return wc == ' ' || wc == '\t';
+}
+
+#endif
 
 #if defined __MINGW32__