imaxdiv: Avoid link error on OSF/1 with DTK cc.
[gnulib.git] / lib / mbsinit.c
index 869c0a6..8ac2137 100644 (file)
 
 #include "verify.h"
 
+#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
+
+/* On native Windows, 'mbstate_t' is defined as 'int'.  */
+
+int
+mbsinit (const mbstate_t *ps)
+{
+  return ps == NULL || *ps == 0;
+}
+
+#else
+
 /* Platforms that lack mbsinit() also lack mbrlen(), mbrtowc(), mbsrtowcs()
    and wcrtomb(), wcsrtombs().
    We assume that
@@ -45,3 +57,5 @@ mbsinit (const mbstate_t *ps)
 
   return pstate == NULL || pstate[0] == 0;
 }
+
+#endif