aboutsummaryrefslogtreecommitdiff
path: root/lib/strerror.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2004-11-02 10:12:22 +0000
committerDaniel Stenberg <daniel@haxx.se>2004-11-02 10:12:22 +0000
commit24d47a6e07304cf0921f2d30734b3c64360773c3 (patch)
tree03bae425fc10d6c083e866a3e1ab5bf620dffe42 /lib/strerror.c
parent8a66584db4ab3bd1668a685785da7108f7550e95 (diff)
Paul Nolan fix to make libcurl build nicely on Windows CE
Diffstat (limited to 'lib/strerror.c')
-rw-r--r--lib/strerror.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/lib/strerror.c b/lib/strerror.c
index dd5acc81b..fa84a1731 100644
--- a/lib/strerror.c
+++ b/lib/strerror.c
@@ -515,15 +515,29 @@ const char *Curl_strerror(struct connectdata *conn, int err)
*buf = '\0';
#if defined(WIN32) && !defined(__CYGWIN__)
+
+#if _WIN32_WCE
+ buf[0]=0;
+ {
+ wchar_t wbuf[256];
+
+ FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, err,
+ LANG_NEUTRAL, wbuf, sizeof(wbuf)/sizeof(wchar_t), NULL);
+ wcstombs(buf,wbuf,max);
+ }
+
+#else
+
/* 'sys_nerr' is the maximum errno number, it is not widely portable */
if (err >= 0 && err < sys_nerr)
strncpy(buf, strerror(err), max);
else {
- if (!get_winsock_error (err, buf, max) &&
- !FormatMessage (FORMAT_MESSAGE_FROM_SYSTEM, NULL, err,
- LANG_NEUTRAL, buf, max, NULL))
+ if (!get_winsock_error(err, buf, max) &&
+ !FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, err,
+ LANG_NEUTRAL, buf, max, NULL))
snprintf(buf, max, "Unknown error %d (%#x)", err, err);
}
+#endif
#else /* not native Windows coming up */
/* These should be atomic and hopefully thread-safe */