diff --git a/dlls/msvcrt/math.c b/dlls/msvcrt/math.c index 06f4eb523a6..384b22b2d60 100644 --- a/dlls/msvcrt/math.c +++ b/dlls/msvcrt/math.c @@ -737,12 +737,10 @@ char *_gcvt( double number, int ndigit, char *buff ) * [i386] Windows binary compatible - returns the struct in eax/edx. */ #ifdef __i386__ -LONGLONG MSVCRT_div(int num, int denom) +unsigned __int64 MSVCRT_div(int num, int denom) { - LONGLONG retval; div_t dt = div(num,denom); - retval = ((LONGLONG)dt.rem << 32) | dt.quot; - return retval; + return ((unsigned __int64)dt.rem << 32) | (unsigned int)dt.quot; } #else /********************************************************************* @@ -769,12 +767,10 @@ MSVCRT_div_t MSVCRT_div(int num, int denom) * [i386] Windows binary compatible - returns the struct in eax/edx. */ #ifdef __i386__ -ULONGLONG MSVCRT_ldiv(long num, long denom) +unsigned __int64 MSVCRT_ldiv(long num, long denom) { - ULONGLONG retval; ldiv_t ldt = ldiv(num,denom); - retval = ((ULONGLONG)ldt.rem << 32) | (ULONG)ldt.quot; - return retval; + return ((unsigned __int64)ldt.rem << 32) | (unsigned long)ldt.quot; } #else /********************************************************************* diff --git a/include/msvcrt/stdlib.h b/include/msvcrt/stdlib.h index 35a90364a47..9ae998d9b46 100644 --- a/include/msvcrt/stdlib.h +++ b/include/msvcrt/stdlib.h @@ -170,10 +170,7 @@ double MSVCRT(atof)(const char*); int MSVCRT(atoi)(const char*); long MSVCRT(atol)(const char*); void* MSVCRT(calloc)(MSVCRT(size_t),MSVCRT(size_t)); -#ifdef __i386__ -__int64 MSVCRT(div)(int,int); -unsigned __int64 MSVCRT(ldiv)(long,long); -#else +#ifndef __i386__ MSVCRT(div_t) MSVCRT(div)(int,int); MSVCRT(ldiv_t) MSVCRT(ldiv)(long,long); #endif @@ -242,6 +239,30 @@ static inline _onexit_t onexit(_onexit_t func) { return _onexit(func); } static inline int putenv(const char* str) { return _putenv(str); } static inline void swab(char* src, char* dst, int len) { _swab(src, dst, len); } static inline char* ultoa(unsigned long value, char* str, int radix) { return _ultoa(value, str, radix); } + +#ifdef __i386__ +static inline div_t __wine_msvcrt_div(int num, int denom) +{ + extern unsigned __int64 div(int,int); + div_t ret; + unsigned __int64 res = div(num,denom); + ret.quot = (int)res; + ret.rem = (int)(res >> 32); + return ret; +} +static inline ldiv_t __wine_msvcrt_ldiv(long num, long denom) +{ + extern unsigned __int64 ldiv(long,long); + ldiv_t ret; + unsigned __int64 res = ldiv(num,denom); + ret.quot = (long)res; + ret.rem = (long)(res >> 32); + return ret; +} +#define div(num,denom) __wine_msvcrt_div(num,denom) +#define ldiv(num,denom) __wine_msvcrt_ldiv(num,denom) +#endif + #endif /* USE_MSVCRT_PREFIX */ #endif /* __WINE_STDLIB_H */ diff --git a/tools/winebuild/import.c b/tools/winebuild/import.c index 1fed43b0c38..f45ab86e162 100644 --- a/tools/winebuild/import.c +++ b/tools/winebuild/import.c @@ -80,14 +80,12 @@ static const char * const default_ignored_symbols[] = "ceil", "cos", "cosh", - "div", "exp", "fabs", "floor", "fmod", "frexp", "labs", - "ldiv", "log", "log10", "memchr",