https://git.reactos.org/?p=reactos.git;a=commitdiff;h=620f3332521b7912e24032...
commit 620f3332521b7912e24032bed4e1764562a674ae Author: Jérôme Gardou jerome.gardou@reactos.org AuthorDate: Fri Apr 9 14:59:33 2021 +0200 Commit: Jérôme Gardou jerome.gardou@reactos.org CommitDate: Fri Apr 9 15:00:07 2021 +0200
[CRT] Fix rot functions aliases in non-x86 clang builds --- sdk/lib/crt/stdlib/rot.c | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-)
diff --git a/sdk/lib/crt/stdlib/rot.c b/sdk/lib/crt/stdlib/rot.c index 51a6a6c0218..cb82df097fd 100644 --- a/sdk/lib/crt/stdlib/rot.c +++ b/sdk/lib/crt/stdlib/rot.c @@ -11,25 +11,27 @@ #include <stdlib.h>
#ifdef __clang__ -#define _rotl __function_rotl -#define _rotr __function_rotr -#define _lrotl __function_lrotl -#define _lrotr __function_lrotr +# define _rotl __function_rotl +# define _rotr __function_rotr +# define _lrotl __function_lrotl +# define _lrotr __function_lrotr #elif defined(_MSC_VER) -#pragma function(_rotr, _rotl, _rotr, _lrotl, _lrotr) +# pragma function(_rotr, _rotl, _rotr, _lrotl, _lrotr) #endif
#if defined (__clang__) && !defined(_MSC_VER) -#define ASM_ALIAS __asm__ -#else -#define ASM_ALIAS(x) +# ifdef _M_IX86 +unsigned int _rotr( unsigned int value, int shift ) __asm__("__rotr"); +unsigned long _lrotr(unsigned long value, int shift) __asm__("__lrotr"); +unsigned int _rotl( unsigned int value, int shift ) __asm__("__rotl"); +unsigned long _lrotl( unsigned long value, int shift ) __asm__("__lrotl"); +# else +unsigned int _rotr( unsigned int value, int shift ) __asm__("_rotr"); +unsigned long _lrotr(unsigned long value, int shift) __asm__("_lrotr"); +unsigned int _rotl( unsigned int value, int shift ) __asm__("_rotl"); +unsigned long _lrotl( unsigned long value, int shift ) __asm__("_lrotl"); +# endif #endif - -unsigned int _rotr( unsigned int value, int shift ) ASM_ALIAS("__rotr"); -unsigned long _lrotr(unsigned long value, int shift) ASM_ALIAS("__lrotr"); -unsigned int _rotl( unsigned int value, int shift ) ASM_ALIAS("__rotl"); -unsigned long _lrotl( unsigned long value, int shift ) ASM_ALIAS("__lrotl"); - /* * @implemented */