Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
1.0 KiB

  1. /* xstod.c -- dummies for _Sto* */
  2. #include <stdlib.h>
  3. #ifndef _CRTIMP2
  4. #ifdef CRTDLL2
  5. #define _CRTIMP2 __declspec(dllexport)
  6. #else /* ndef CRTDLL2 */
  7. #ifdef _DLL
  8. #define _CRTIMP2 __declspec(dllimport)
  9. #else /* ndef _DLL */
  10. #define _CRTIMP2
  11. #endif /* _DLL */
  12. #endif /* CRTDLL2 */
  13. #endif /* _CRTIMP2 */
  14. _CRTIMP2 double __cdecl _Stod(const char *s, char **endptr, long pten)
  15. { /* convert string to double */
  16. double x = strtod(s, endptr);
  17. for (; 0 < pten; --pten)
  18. x *= 10.0;
  19. for (; pten < 0; ++pten)
  20. x /= 10.0;
  21. return (x);
  22. }
  23. _CRTIMP2 float __cdecl _Stof(const char *s, char **endptr, long pten)
  24. { /* convert string to float */
  25. return ((float)_Stod(s, endptr, pten));
  26. }
  27. _CRTIMP2 long double __cdecl _Stold(const char *s, char **endptr, long pten)
  28. { /* convert string to long double */
  29. return ((long double)_Stod(s, endptr, pten));
  30. }
  31. /*
  32. * Copyright (c) 1992-2001 by P.J. Plauger. ALL RIGHTS RESERVED.
  33. * Consult your license regarding permissions and restrictions.
  34. V3.10:0009 */