msvcrt wcstod

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

This allows wordpad.exe from XP to run with builtin msvcrt.

Changelog:

  Jon Griffiths <jon_p_griffiths@yahoo.com>
  +dlls/msvcrt/msvcrt.spec dlls/msvcrt/wcs.c
    A first stab at wcstod()











__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com
--- wine/dlls/msvcrt/msvcrt.spec	2003-08-20 15:11:41.000000000 +0100
+++ wine-develop/dlls/msvcrt/msvcrt.spec	2003-09-21 07:43:38.000000000 +0100
@@ -753,7 +753,7 @@
 @ cdecl wcsrchr(wstr long) ntdll.wcsrchr
 @ cdecl wcsspn(wstr wstr) ntdll.wcsspn
 @ cdecl wcsstr(wstr wstr) ntdll.wcsstr
-@ stub wcstod #(wstr ptr)
+@ cdecl wcstod(wstr ptr) MSVCRT_wcstod
 @ cdecl wcstok(wstr wstr) ntdll.wcstok
 @ cdecl wcstol(wstr ptr long) ntdll.wcstol
 @ cdecl wcstombs(ptr ptr long) ntdll.wcstombs
--- wine/dlls/msvcrt/wcs.c	2003-03-15 18:07:58.000000000 +0000
+++ wine-develop/dlls/msvcrt/wcs.c	2003-09-21 07:45:46.000000000 +0100
@@ -112,6 +112,52 @@
 }
 
 /*********************************************************************
+ *		wcstod (MSVCRT.@)
+ */
+double MSVCRT_wcstod(const MSVCRT_wchar_t* lpszStr, MSVCRT_wchar_t** end)
+{
+  const MSVCRT_wchar_t* str = lpszStr;
+  int negative = 0;
+  double ret = 0, divisor = 10.0;
+
+  TRACE("(%s,%p) semi-stub\n", debugstr_w(lpszStr), end);
+
+  /* FIXME:
+   * - Should set errno on failure
+   * - Should fail on overflow
+   * - Need to check which input formats are allowed
+   */
+  while (isspaceW(*str))
+    str++;
+
+  if (*str == '-')
+  {
+    negative = 1;
+    str++;
+  }
+
+  while (isdigitW(*str))
+  {
+    ret = ret * 10.0 + (*str - '0');
+    str++;
+  }
+  if (*str == '.')
+    str++;
+  while (isdigitW(*str))
+  {
+    ret = ret + (*str - '0') / divisor;
+    divisor *= 10;
+    str++;
+  }
+
+  if (end)
+    *end = (MSVCRT_wchar_t*)str;
+
+  TRACE("returning %g\n", ret);
+  return ret;
+}
+
+/*********************************************************************
  *		_vsnwprintf (MSVCRT.@)
  */
 int _vsnwprintf(MSVCRT_wchar_t *str, unsigned int len,

[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux