Index: lib/builtins/extendhfsf2.c =================================================================== --- lib/builtins/extendhfsf2.c +++ lib/builtins/extendhfsf2.c @@ -14,7 +14,7 @@ // Use a forwarding definition and noinline to implement a poor man's alias, // as there isn't a good cross-platform way of defining one. -COMPILER_RT_ABI __attribute__((noinline)) float __extendhfsf2(uint16_t a) { +COMPILER_RT_ABI NOINLINE float __extendhfsf2(uint16_t a) { return __extendXfYf2__(a); } Index: lib/builtins/int_lib.h =================================================================== --- lib/builtins/int_lib.h +++ lib/builtins/int_lib.h @@ -35,13 +35,23 @@ # define COMPILER_RT_ABI __attribute__((pcs("aapcs"))) #else # define ARM_EABI_FNALIAS(aeabi_name, name) -# if defined(__arm__) && defined(_WIN32) +# if defined(__arm__) && defined(_WIN32) && (!defined(_MSC_VER) || defined(__clang__)) # define COMPILER_RT_ABI __attribute__((pcs("aapcs"))) # else # define COMPILER_RT_ABI # endif #endif +#ifdef _MSC_VER +#define NOINLINE __declspec(noinline) +#define NORETURN __declspec(noreturn) +#define UNUSED +#else +#define NOINLINE __attribute__((noinline)) +#define NORETURN __attribute__((noreturn)) +#define UNUSED __attribute__((unused)) +#endif + #if defined(__NetBSD__) && (defined(_KERNEL) || defined(_STANDALONE)) /* * Kernel and boot environment can't use normal headers, Index: lib/builtins/int_util.h =================================================================== --- lib/builtins/int_util.h +++ lib/builtins/int_util.h @@ -23,12 +23,12 @@ #define compilerrt_abort() compilerrt_abort_impl(__FILE__, __LINE__, \ __func__) -void compilerrt_abort_impl(const char *file, int line, - const char *function) __attribute__((noreturn)); +NORETURN void compilerrt_abort_impl(const char *file, int line, + const char *function); #define COMPILE_TIME_ASSERT(expr) COMPILE_TIME_ASSERT1(expr, __COUNTER__) #define COMPILE_TIME_ASSERT1(expr, cnt) COMPILE_TIME_ASSERT2(expr, cnt) #define COMPILE_TIME_ASSERT2(expr, cnt) \ - typedef char ct_assert_##cnt[(expr) ? 1 : -1] __attribute__((unused)) + typedef char ct_assert_##cnt[(expr) ? 1 : -1] UNUSED #endif /* INT_UTIL_H */ Index: lib/builtins/truncsfhf2.c =================================================================== --- lib/builtins/truncsfhf2.c +++ lib/builtins/truncsfhf2.c @@ -13,7 +13,7 @@ // Use a forwarding definition and noinline to implement a poor man's alias, // as there isn't a good cross-platform way of defining one. -COMPILER_RT_ABI __attribute__((noinline)) uint16_t __truncsfhf2(float a) { +COMPILER_RT_ABI NOINLINE uint16_t __truncsfhf2(float a) { return __truncXfYf2__(a); }