From 6c04a187d24a396b0a141ddf96959f6c7c834c6e Mon Sep 17 00:00:00 2001 From: Louis Lenders Date: Sun, 17 Dec 2006 17:56:50 +0000 Subject: [PATCH] msvcrt: Add _atoldbl. --- configure | 2 ++ configure.ac | 1 + dlls/msvcrt/msvcrt.h | 2 ++ dlls/msvcrt/msvcrt.spec | 2 +- dlls/msvcrt/string.c | 18 ++++++++++++++++++ include/config.h.in | 3 +++ 6 files changed, 27 insertions(+), 1 deletion(-) diff --git a/configure b/configure index b60889dc307..67791215d85 100755 --- a/configure +++ b/configure @@ -15843,6 +15843,7 @@ fi + for ac_func in \ @@ -15910,6 +15911,7 @@ for ac_func in \ strcasecmp \ strerror \ strncasecmp \ + strtold \ tcgetattr \ timegm \ usleep \ diff --git a/configure.ac b/configure.ac index f44e3ebd38a..efbf32d4a7d 100644 --- a/configure.ac +++ b/configure.ac @@ -1228,6 +1228,7 @@ AC_CHECK_FUNCS(\ strcasecmp \ strerror \ strncasecmp \ + strtold \ tcgetattr \ timegm \ usleep \ diff --git a/dlls/msvcrt/msvcrt.h b/dlls/msvcrt/msvcrt.h index 0066e3da991..3a50af20f5f 100644 --- a/dlls/msvcrt/msvcrt.h +++ b/dlls/msvcrt/msvcrt.h @@ -70,6 +70,8 @@ typedef void (*MSVCRT__beginthread_start_routine_t)(void *); typedef unsigned int (__stdcall *MSVCRT__beginthreadex_start_routine_t)(void *); typedef int (*MSVCRT__onexit_t)(void); +typedef struct {long double x;} _LDOUBLE; + struct MSVCRT_tm { int tm_sec; int tm_min; diff --git a/dlls/msvcrt/msvcrt.spec b/dlls/msvcrt/msvcrt.spec index 59e21f653f7..771204583cb 100644 --- a/dlls/msvcrt/msvcrt.spec +++ b/dlls/msvcrt/msvcrt.spec @@ -166,7 +166,7 @@ @ cdecl _assert(str str long) MSVCRT__assert @ stub _atodbl #(ptr str) @ cdecl -ret64 _atoi64(str) ntdll._atoi64 -@ stub _atoldbl #(ptr str) +@ cdecl _atoldbl(ptr str) MSVCRT__atoldbl @ cdecl _beep(long long) @ cdecl _beginthread (ptr long ptr) @ cdecl _beginthreadex (ptr long ptr ptr long ptr) diff --git a/dlls/msvcrt/string.c b/dlls/msvcrt/string.c index 6dfce9a5ecd..ec4bd703b77 100644 --- a/dlls/msvcrt/string.c +++ b/dlls/msvcrt/string.c @@ -21,6 +21,9 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#define _ISOC99_SOURCE +#include "config.h" + #include #include "msvcrt.h" #include "wine/debug.h" @@ -184,3 +187,18 @@ int CDECL MSVCRT__stricoll( const char* str1, const char* str2 ) TRACE("str1 %s str2 %s\n", debugstr_a(str1), debugstr_a(str2)); return lstrcmpiA( str1, str2 ); } + +/******************************************************************** + * _atoldbl (MSVCRT.@) + */ +int CDECL MSVCRT__atoldbl(_LDOUBLE * value, char * str) +{ + /* FIXME needs error checking for huge/small values */ +#ifdef HAVE_STRTOLD + TRACE("str %s value %p\n",str,value); + value->x = strtold(str,0); +#else + FIXME("stub, str %s value %p\n",str,value); +#endif + return 0; +} diff --git a/include/config.h.in b/include/config.h.in index 11bd3bbffe7..6f5387acbd6 100644 --- a/include/config.h.in +++ b/include/config.h.in @@ -666,6 +666,9 @@ /* Define to 1 if you have the `strncasecmp' function. */ #undef HAVE_STRNCASECMP +/* Define to 1 if you have the `strtold' function. */ +#undef HAVE_STRTOLD + /* Define to 1 if `direction' is member of `struct ff_effect'. */ #undef HAVE_STRUCT_FF_EFFECT_DIRECTION