From b99bfa42f2680122ec144ccc74db704472f5e074 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sun, 30 May 2010 18:46:02 +0000 Subject: [PATCH] - partly revert r47442 and apply a working fix by guarding some prototypes of functions that exist as intrinsics in #ifdefs, so we don't use them for gcc/clang - remove duplicated prototypes, when an inline function exists already svn path=/trunk/; revision=47453 --- reactos/include/crt/math.h | 3 --- reactos/include/crt/mingw32/intrin_x86.h | 10 +++++----- reactos/include/crt/stdlib.h | 8 +++++++- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/reactos/include/crt/math.h b/reactos/include/crt/math.h index 9b645c15a51..fe4b4bc65b8 100644 --- a/reactos/include/crt/math.h +++ b/reactos/include/crt/math.h @@ -435,8 +435,6 @@ __CRT_INLINE int isinf (double d) { return res; } - extern long double __cdecl modfl (long double, long double*); - /* 7.12.6.13 */ extern double __cdecl scalbn (double, int); extern float __cdecl scalbnf (float, int); @@ -458,7 +456,6 @@ __CRT_INLINE int isinf (double d) { extern long double __cdecl expl(long double); extern long double expm1l(long double); extern long double __cdecl coshl(long double); - extern long double __cdecl fabsl (long double); extern long double __cdecl acosl(long double); extern long double __cdecl asinl(long double); extern long double __cdecl atanl(long double); diff --git a/reactos/include/crt/mingw32/intrin_x86.h b/reactos/include/crt/mingw32/intrin_x86.h index bf9470e1237..5b6f32d18a3 100644 --- a/reactos/include/crt/mingw32/intrin_x86.h +++ b/reactos/include/crt/mingw32/intrin_x86.h @@ -879,14 +879,14 @@ __INTRIN_INLINE unsigned short _rotl16(unsigned short value, unsigned char shift return retval; } -__INTRIN_INLINE unsigned int __cdecl _rotl(unsigned int value, int shift) +__INTRIN_INLINE unsigned int _rotl(unsigned int value, int shift) { unsigned long retval; __asm__("roll %b[shift], %k[retval]" : [retval] "=rm" (retval) : "[retval]" (value), [shift] "Nc" (shift)); return retval; } -__INTRIN_INLINE unsigned int __cdecl _rotr(unsigned int value, int shift) +__INTRIN_INLINE unsigned int _rotr(unsigned int value, int shift) { unsigned long retval; __asm__("rorl %b[shift], %k[retval]" : [retval] "=rm" (retval) : "[retval]" (value), [shift] "Nc" (shift)); @@ -956,14 +956,14 @@ __INTRIN_INLINE unsigned long long __ull_rshift(const unsigned long long Mask, i return retval; } -__INTRIN_INLINE unsigned short __cdecl _byteswap_ushort(unsigned short value) +__INTRIN_INLINE unsigned short _byteswap_ushort(unsigned short value) { unsigned short retval; __asm__("rorw $8, %w[retval]" : [retval] "=rm" (retval) : "[retval]" (value)); return retval; } -__INTRIN_INLINE unsigned long __cdecl _byteswap_ulong(unsigned long value) +__INTRIN_INLINE unsigned long _byteswap_ulong(unsigned long value) { unsigned long retval; __asm__("bswapl %[retval]" : [retval] "=r" (retval) : "[retval]" (value)); @@ -971,7 +971,7 @@ __INTRIN_INLINE unsigned long __cdecl _byteswap_ulong(unsigned long value) } #ifdef _M_AMD64 -__INTRIN_INLINE unsigned __int64 __cdecl _byteswap_uint64(unsigned __int64 value) +__INTRIN_INLINE unsigned __int64 _byteswap_uint64(unsigned __int64 value) { unsigned __int64 retval; __asm__("bswapq %[retval]" : [retval] "=r" (retval) : "[retval]" (value)); diff --git a/reactos/include/crt/stdlib.h b/reactos/include/crt/stdlib.h index d4846fa2c71..0efd5cc4321 100644 --- a/reactos/include/crt/stdlib.h +++ b/reactos/include/crt/stdlib.h @@ -345,11 +345,15 @@ extern "C" { void *__cdecl bsearch(const void *_Key,const void *_Base,size_t _NumOfElements,size_t _SizeOfElements,int (__cdecl *_PtFuncCompare)(const void *,const void *)); void __cdecl qsort(void *_Base,size_t _NumOfElements,size_t _SizeOfElements,int (__cdecl *_PtFuncCompare)(const void *,const void *)); #endif + +#if !defined(__GNUC__) && !defined(__clang) unsigned short __cdecl _byteswap_ushort(unsigned short _Short); - /*unsigned long __cdecl _byteswap_ulong (unsigned long _Long); */ + unsigned long __cdecl _byteswap_ulong (unsigned long _Long); #if _INTEGRAL_MAX_BITS >= 64 __MINGW_EXTENSION unsigned __int64 __cdecl _byteswap_uint64(unsigned __int64 _Int64); #endif +#endif + div_t __cdecl div(int _Numerator,int _Denominator); char *__cdecl getenv(const char *_VarName); _CRTIMP char *__cdecl _itoa(int _Value,char *_Dest,int _Radix); @@ -478,6 +482,7 @@ extern "C" { void __cdecl perror(const char *_ErrMsg); #endif _CRTIMP int __cdecl _putenv(const char *_EnvString); +#if !defined(__GNUC__) && !defined(__clang) unsigned int __cdecl _rotl(unsigned int _Val,int _Shift); #if _INTEGRAL_MAX_BITS >= 64 __MINGW_EXTENSION unsigned __int64 __cdecl _rotl64(unsigned __int64 _Val,int _Shift); @@ -485,6 +490,7 @@ extern "C" { unsigned int __cdecl _rotr(unsigned int _Val,int _Shift); #if _INTEGRAL_MAX_BITS >= 64 __MINGW_EXTENSION unsigned __int64 __cdecl _rotr64(unsigned __int64 _Val,int _Shift); +#endif #endif _CRTIMP void __cdecl _searchenv(const char *_Filename,const char *_EnvVar,char *_ResultPath); _CRTIMP void __cdecl _splitpath(const char *_FullPath,char *_Drive,char *_Dir,char *_Filename,char *_Ext);