From 758148a0cb7a2b9611b905d0bdc0b84f6ae703bc Mon Sep 17 00:00:00 2001 From: Jacob Szwejbka Date: Wed, 15 Oct 2025 23:37:11 -0700 Subject: [PATCH 1/6] add a bunch of msvc variants --- runtime/platform/compiler.h | 170 +++++++++++++++++++----------------- 1 file changed, 90 insertions(+), 80 deletions(-) diff --git a/runtime/platform/compiler.h b/runtime/platform/compiler.h index c7bf4b7de1e..e0ff2aeb298 100644 --- a/runtime/platform/compiler.h +++ b/runtime/platform/compiler.h @@ -13,140 +13,139 @@ #pragma once -/* - * Compiler support checks. Follows the logic used by pytorch/c10/util/C++17.h - * but may support older versions. - */ +// ----------------------------------------------------------------------------- +// Compiler version checks +// ----------------------------------------------------------------------------- -// https://gcc.gnu.org/projects/cxx-status.html#cxx17 -#if !defined(__clang__) && !defined(_MSC_VER) && defined(__GNUC__) && \ - __GNUC__ < 7 -#error \ - "You're trying to build ExecuTorch with a too old version of GCC. We need GCC 7 or later." +// GCC version check +#if !defined(__clang__) && !defined(_MSC_VER) && defined(__GNUC__) && __GNUC__ < 7 +#error "You're trying to build ExecuTorch with a too old version of GCC. We need GCC 7 or later." #endif -// https://clang.llvm.org/cxx_status.html#cxx17 +// Clang version check #if defined(__clang__) && __clang_major__ < 5 -#error \ - "You're trying to build ExecuTorch with a too old version of Clang. We need Clang 5 or later." +#error "You're trying to build ExecuTorch with a too old version of Clang. We need Clang 5 or later." #endif +// C++17 check #if (defined(_MSC_VER) && (!defined(_MSVC_LANG) || _MSVC_LANG < 201703L)) || \ (!defined(_MSC_VER) && __cplusplus < 201703L) #error "You need C++17 to compile ExecuTorch" #endif +// Windows min/max macro clash #if defined(_MSC_VER) && (defined(min) || defined(max)) -#error \ - "Macro clash with min and max -- define NOMINMAX when compiling your program on Windows" +#error "Macro clash with min and max -- define NOMINMAX when compiling your program on Windows" #endif -/* - * Define annotations aliasing C++ declaration attributes. - * See all C++ declaration attributes here: - * https://en.cppreference.com/w/cpp/language/attributes - * - * Note that ExecuTorch supports a lower C++ standard version than all standard - * attributes. Therefore, some annotations are defined using their Clang/GNU - * counterparts. - * - * GNU attribute definitions: - * https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html - */ +// ----------------------------------------------------------------------------- +// Attribute macros +// ----------------------------------------------------------------------------- +// [[noreturn]] #define ET_NORETURN [[noreturn]] + +// [[deprecated]] +#define ET_DEPRECATED [[deprecated]] +#define ET_EXPERIMENTAL [[deprecated("This API is experimental and may change without notice.")]] + +// [[fallthrough]] +#if defined(__clang__) || (defined(__GNUC__) && __GNUC__ >= 7) +#define ET_FALLTHROUGH [[fallthrough]] +#else +#define ET_FALLTHROUGH +#endif + +// [[nodiscard]] +#define ET_NODISCARD [[nodiscard]] + +// [[maybe_unused]] +#define ET_UNUSED [[maybe_unused]] + +// Inline/NoInline +#if defined(_MSC_VER) +#define ET_NOINLINE __declspec(noinline) +#define ET_INLINE __forceinline +#define ET_INLINE_ATTRIBUTE __forceinline +#elif defined(__GNUC__) || defined(__clang__) #define ET_NOINLINE __attribute__((noinline)) #define ET_INLINE __attribute__((always_inline)) inline #define ET_INLINE_ATTRIBUTE __attribute__((always_inline)) +#else +#define ET_NOINLINE +#define ET_INLINE inline +#define ET_INLINE_ATTRIBUTE +#endif -#if defined(__GNUC__) - +// Unreachable +#if defined(__GNUC__) || defined(__clang__) #define ET_UNREACHABLE() __builtin_unreachable() - #elif defined(_MSC_VER) - #define ET_UNREACHABLE() __assume(0) +#else +#define ET_UNREACHABLE() do {} while (1) +#endif -#else // defined(__GNUC__) - -#define ET_UNREACHABLE() \ - while (1) \ - ; - -#endif // defined(__GNUC__) - -#define ET_DEPRECATED [[deprecated]] -#define ET_EXPERIMENTAL \ - [[deprecated("This API is experimental and may change without notice.")]] -#define ET_FALLTHROUGH [[fallthrough]] -#define ET_NODISCARD [[nodiscard]] -#define ET_UNUSED [[maybe_unused]] - -// UNLIKELY Macro -// example -// if ET_UNLIKELY(a > 10 && b < 5) { -// do something -// } +// Likely/Unlikely #if (__cplusplus) >= 202002L - #define ET_LIKELY(expr) (expr) [[likely]] #define ET_UNLIKELY(expr) (expr) [[unlikely]] - #else - #define ET_LIKELY(expr) (expr) #define ET_UNLIKELY(expr) (expr) +#endif -#endif // (__cplusplus) >= 202002L - -/// Define a C symbol with weak linkage. -#ifdef _MSC_VER -// There currently doesn't seem to be a great way to do this in Windows and -// given that weak linkage is not really critical on Windows, we'll just leave -// it as a stub. +// Weak linkage +#if defined(_MSC_VER) +// No weak linkage in MSVC #define ET_WEAK -#else +#elif defined(__GNUC__) || defined(__clang__) #define ET_WEAK __attribute__((weak)) +#else +#define ET_WEAK #endif -/** - * Annotation marking a function as printf-like, providing compiler support - * for format string argument checking. - */ -#ifdef _MSC_VER +// Printf-like format checking +#if defined(_MSC_VER) #include #define ET_PRINTFLIKE(_string_index, _va_index) _Printf_format_string_ -#else +#elif defined(__GNUC__) || defined(__clang__) #define ET_PRINTFLIKE(_string_index, _va_index) \ __attribute__((format(printf, _string_index, _va_index))) +#else +#define ET_PRINTFLIKE(_string_index, _va_index) #endif +// ----------------------------------------------------------------------------- +// Builtin/Source location helpers +// ----------------------------------------------------------------------------- + #ifndef __has_builtin -#define __has_builtin(x) (0) +#define __has_builtin(x) 0 #endif #if __has_builtin(__builtin_strrchr) -/// Name of the source file without a directory string. #define ET_SHORT_FILENAME (__builtin_strrchr("/" __FILE__, '/') + 1) #else #define ET_SHORT_FILENAME __FILE__ #endif #if __has_builtin(__builtin_LINE) -/// Current line as an integer. #define ET_LINE __builtin_LINE() #else #define ET_LINE __LINE__ -#endif // __has_builtin(__builtin_LINE) +#endif #if __has_builtin(__builtin_FUNCTION) -/// Name of the current function as a const char[]. #define ET_FUNCTION __builtin_FUNCTION() #else #define ET_FUNCTION __FUNCTION__ -#endif // __has_builtin(__builtin_FUNCTION) +#endif + +// ----------------------------------------------------------------------------- +// Format specifiers for size_t/ssize_t +// ----------------------------------------------------------------------------- -// As of G3 RJ-2024.3 toolchain, zu format specifier is not supported for Xtensa #if defined(__XTENSA__) #define ET_PRIsize_t "lu" #define ET_PRIssize_t "ld" @@ -155,17 +154,22 @@ #define ET_PRIssize_t "zd" #endif -// Whether the compiler supports GNU statement expressions. -// https://gcc.gnu.org/onlinedocs/gcc/Statement-Exprs.html +// ----------------------------------------------------------------------------- +// GNU statement expressions +// ----------------------------------------------------------------------------- + #ifndef ET_HAVE_GNU_STATEMENT_EXPRESSIONS #if (defined(__GNUC__) && __GNUC__ >= 3) || defined(__clang__) #define ET_HAVE_GNU_STATEMENT_EXPRESSIONS 1 #else #define ET_HAVE_GNU_STATEMENT_EXPRESSIONS 0 #endif -#endif // ifndef +#endif + +// ----------------------------------------------------------------------------- +// ssize_t definition +// ----------------------------------------------------------------------------- -// Define size_t and ssize_t. #ifndef _MSC_VER #include #else @@ -173,6 +177,10 @@ using ssize_t = ptrdiff_t; #endif +// ----------------------------------------------------------------------------- +// Exception support +// ----------------------------------------------------------------------------- + #ifdef __EXCEPTIONS #define ET_HAS_EXCEPTIONS 1 #elif defined(_MSC_VER) && defined(_HAS_EXCEPTIONS) && _HAS_EXCEPTIONS @@ -181,8 +189,10 @@ using ssize_t = ptrdiff_t; #define ET_HAS_EXCEPTIONS 0 #endif -// DEPRECATED: Use the non-underscore-prefixed versions instead. -// TODO(T199005537): Remove these once all users have stopped using them. +// ----------------------------------------------------------------------------- +// Deprecated legacy macros (to be removed) +// ----------------------------------------------------------------------------- + #define __ET_DEPRECATED ET_DEPRECATED #define __ET_FALLTHROUGH ET_FALLTHROUGH #define __ET_FUNCTION ET_FUNCTION From 34473aa0c81a5a9edc59348700f25ed7214ec69e Mon Sep 17 00:00:00 2001 From: Jacob Szwejbka Date: Thu, 16 Oct 2025 10:17:02 -0700 Subject: [PATCH 2/6] clean up --- runtime/platform/compiler.h | 35 +++++++++++++++-------------------- 1 file changed, 15 insertions(+), 20 deletions(-) diff --git a/runtime/platform/compiler.h b/runtime/platform/compiler.h index e0ff2aeb298..9619c3f7468 100644 --- a/runtime/platform/compiler.h +++ b/runtime/platform/compiler.h @@ -18,13 +18,16 @@ // ----------------------------------------------------------------------------- // GCC version check -#if !defined(__clang__) && !defined(_MSC_VER) && defined(__GNUC__) && __GNUC__ < 7 -#error "You're trying to build ExecuTorch with a too old version of GCC. We need GCC 7 or later." +#if !defined(__clang__) && !defined(_MSC_VER) && defined(__GNUC__) && \ + __GNUC__ < 7 +#error \ + "You're trying to build ExecuTorch with a too old version of GCC. We need GCC 7 or later." #endif // Clang version check #if defined(__clang__) && __clang_major__ < 5 -#error "You're trying to build ExecuTorch with a too old version of Clang. We need Clang 5 or later." +#error \ + "You're trying to build ExecuTorch with a too old version of Clang. We need Clang 5 or later." #endif // C++17 check @@ -35,7 +38,8 @@ // Windows min/max macro clash #if defined(_MSC_VER) && (defined(min) || defined(max)) -#error "Macro clash with min and max -- define NOMINMAX when compiling your program on Windows" +#error \ + "Macro clash with min and max -- define NOMINMAX when compiling your program on Windows" #endif // ----------------------------------------------------------------------------- @@ -47,7 +51,8 @@ // [[deprecated]] #define ET_DEPRECATED [[deprecated]] -#define ET_EXPERIMENTAL [[deprecated("This API is experimental and may change without notice.")]] +#define ET_EXPERIMENTAL \ + [[deprecated("This API is experimental and may change without notice.")]] // [[fallthrough]] #if defined(__clang__) || (defined(__GNUC__) && __GNUC__ >= 7) @@ -67,23 +72,17 @@ #define ET_NOINLINE __declspec(noinline) #define ET_INLINE __forceinline #define ET_INLINE_ATTRIBUTE __forceinline -#elif defined(__GNUC__) || defined(__clang__) +#else #define ET_NOINLINE __attribute__((noinline)) #define ET_INLINE __attribute__((always_inline)) inline #define ET_INLINE_ATTRIBUTE __attribute__((always_inline)) -#else -#define ET_NOINLINE -#define ET_INLINE inline -#define ET_INLINE_ATTRIBUTE #endif // Unreachable -#if defined(__GNUC__) || defined(__clang__) -#define ET_UNREACHABLE() __builtin_unreachable() -#elif defined(_MSC_VER) +#if defined(_MSC_VER) #define ET_UNREACHABLE() __assume(0) #else -#define ET_UNREACHABLE() do {} while (1) +#define ET_UNREACHABLE() __builtin_unreachable() #endif // Likely/Unlikely @@ -99,21 +98,17 @@ #if defined(_MSC_VER) // No weak linkage in MSVC #define ET_WEAK -#elif defined(__GNUC__) || defined(__clang__) -#define ET_WEAK __attribute__((weak)) #else -#define ET_WEAK +#define ET_WEAK __attribute__((weak)) #endif // Printf-like format checking #if defined(_MSC_VER) #include #define ET_PRINTFLIKE(_string_index, _va_index) _Printf_format_string_ -#elif defined(__GNUC__) || defined(__clang__) +#else #define ET_PRINTFLIKE(_string_index, _va_index) \ __attribute__((format(printf, _string_index, _va_index))) -#else -#define ET_PRINTFLIKE(_string_index, _va_index) #endif // ----------------------------------------------------------------------------- From 658c00053a153915f0dec1f1c0eaff5545974d63 Mon Sep 17 00:00:00 2001 From: Jacob Szwejbka Date: Thu, 16 Oct 2025 10:24:01 -0700 Subject: [PATCH 3/6] fixup --- runtime/platform/compiler.h | 102 ++++++++++++++++++++---------------- 1 file changed, 58 insertions(+), 44 deletions(-) diff --git a/runtime/platform/compiler.h b/runtime/platform/compiler.h index 9619c3f7468..23323cb5bc8 100644 --- a/runtime/platform/compiler.h +++ b/runtime/platform/compiler.h @@ -13,18 +13,19 @@ #pragma once -// ----------------------------------------------------------------------------- -// Compiler version checks -// ----------------------------------------------------------------------------- +/* + * Compiler support checks. Follows the logic used by pytorch/c10/util/C++17.h + * but may support older versions. + */ -// GCC version check +// https://gcc.gnu.org/projects/cxx-status.html#cxx17 #if !defined(__clang__) && !defined(_MSC_VER) && defined(__GNUC__) && \ __GNUC__ < 7 #error \ "You're trying to build ExecuTorch with a too old version of GCC. We need GCC 7 or later." #endif -// Clang version check +// https://clang.llvm.org/cxx_status.html#cxx17 #if defined(__clang__) && __clang_major__ < 5 #error \ "You're trying to build ExecuTorch with a too old version of Clang. We need Clang 5 or later." @@ -42,29 +43,33 @@ "Macro clash with min and max -- define NOMINMAX when compiling your program on Windows" #endif -// ----------------------------------------------------------------------------- -// Attribute macros -// ----------------------------------------------------------------------------- +/* + * Define annotations aliasing C++ declaration attributes. + * See all C++ declaration attributes here: + * https://en.cppreference.com/w/cpp/language/attributes + * + * Note that ExecuTorch supports a lower C++ standard version than all standard + * attributes. Therefore, some annotations are defined using their Clang/GNU + * counterparts. + * + * GNU attribute definitions: + * https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html + */ -// [[noreturn]] #define ET_NORETURN [[noreturn]] -// [[deprecated]] #define ET_DEPRECATED [[deprecated]] #define ET_EXPERIMENTAL \ [[deprecated("This API is experimental and may change without notice.")]] -// [[fallthrough]] #if defined(__clang__) || (defined(__GNUC__) && __GNUC__ >= 7) #define ET_FALLTHROUGH [[fallthrough]] #else #define ET_FALLTHROUGH #endif -// [[nodiscard]] #define ET_NODISCARD [[nodiscard]] -// [[maybe_unused]] #define ET_UNUSED [[maybe_unused]] // Inline/NoInline @@ -78,14 +83,27 @@ #define ET_INLINE_ATTRIBUTE __attribute__((always_inline)) #endif -// Unreachable -#if defined(_MSC_VER) -#define ET_UNREACHABLE() __assume(0) -#else +#if defined(__GNUC__) + #define ET_UNREACHABLE() __builtin_unreachable() -#endif -// Likely/Unlikely +#elif defined(_MSC_VER) + +#define ET_UNREACHABLE() __assume(0) + +#else // defined(__GNUC__) + +#define ET_UNREACHABLE() \ + while (1) \ + ; + +#endif // defined(__GNUC__) + +// UNLIKELY Macro +// example +// if ET_UNLIKELY(a > 10 && b < 5) { +// do something +// } #if (__cplusplus) >= 202002L #define ET_LIKELY(expr) (expr) [[likely]] #define ET_UNLIKELY(expr) (expr) [[unlikely]] @@ -94,16 +112,22 @@ #define ET_UNLIKELY(expr) (expr) #endif -// Weak linkage -#if defined(_MSC_VER) +/// Define a C symbol with weak linkage. +#ifdef _MSC_VER +// There currently doesn't seem to be a great way to do this in Windows and +// given that weak linkage is not really critical on Windows, we'll just leave +// it as a stub. // No weak linkage in MSVC #define ET_WEAK #else #define ET_WEAK __attribute__((weak)) #endif -// Printf-like format checking -#if defined(_MSC_VER) +/** + * Annotation marking a function as printf-like, providing compiler support + * for format string argument checking. + */ +#ifdef _MSC_VER #include #define ET_PRINTFLIKE(_string_index, _va_index) _Printf_format_string_ #else @@ -116,31 +140,31 @@ // ----------------------------------------------------------------------------- #ifndef __has_builtin -#define __has_builtin(x) 0 +#define __has_builtin(x) (0) #endif #if __has_builtin(__builtin_strrchr) +/// Name of the source file without a directory string. #define ET_SHORT_FILENAME (__builtin_strrchr("/" __FILE__, '/') + 1) #else #define ET_SHORT_FILENAME __FILE__ #endif #if __has_builtin(__builtin_LINE) +/// Current line as an integer. #define ET_LINE __builtin_LINE() #else #define ET_LINE __LINE__ -#endif +#endif // __has_builtin(__builtin_LINE) #if __has_builtin(__builtin_FUNCTION) +/// Name of the current function as a const char[]. #define ET_FUNCTION __builtin_FUNCTION() #else #define ET_FUNCTION __FUNCTION__ -#endif - -// ----------------------------------------------------------------------------- -// Format specifiers for size_t/ssize_t -// ----------------------------------------------------------------------------- +#endif // __has_builtin(__builtin_FUNCTION) +// As of G3 RJ-2024.3 toolchain, zu format specifier is not supported for Xtensa #if defined(__XTENSA__) #define ET_PRIsize_t "lu" #define ET_PRIssize_t "ld" @@ -149,9 +173,8 @@ #define ET_PRIssize_t "zd" #endif -// ----------------------------------------------------------------------------- -// GNU statement expressions -// ----------------------------------------------------------------------------- +// Whether the compiler supports GNU statement expressions. +// https://gcc.gnu.org/onlinedocs/gcc/Statement-Exprs.html #ifndef ET_HAVE_GNU_STATEMENT_EXPRESSIONS #if (defined(__GNUC__) && __GNUC__ >= 3) || defined(__clang__) @@ -161,10 +184,6 @@ #endif #endif -// ----------------------------------------------------------------------------- -// ssize_t definition -// ----------------------------------------------------------------------------- - #ifndef _MSC_VER #include #else @@ -172,10 +191,6 @@ using ssize_t = ptrdiff_t; #endif -// ----------------------------------------------------------------------------- -// Exception support -// ----------------------------------------------------------------------------- - #ifdef __EXCEPTIONS #define ET_HAS_EXCEPTIONS 1 #elif defined(_MSC_VER) && defined(_HAS_EXCEPTIONS) && _HAS_EXCEPTIONS @@ -184,9 +199,8 @@ using ssize_t = ptrdiff_t; #define ET_HAS_EXCEPTIONS 0 #endif -// ----------------------------------------------------------------------------- -// Deprecated legacy macros (to be removed) -// ----------------------------------------------------------------------------- +// DEPRECATED: Use the non-underscore-prefixed versions instead. +// TODO(T199005537): Remove these once all users have stopped using them. #define __ET_DEPRECATED ET_DEPRECATED #define __ET_FALLTHROUGH ET_FALLTHROUGH From 05c6aa93cfc3dfc3b4ca48ab72b846641ae6560a Mon Sep 17 00:00:00 2001 From: Jacob Szwejbka Date: Thu, 16 Oct 2025 10:28:00 -0700 Subject: [PATCH 4/6] fix inline --- runtime/platform/compiler.h | 39 +++++++++++++------------------------ 1 file changed, 14 insertions(+), 25 deletions(-) diff --git a/runtime/platform/compiler.h b/runtime/platform/compiler.h index 23323cb5bc8..af996e32967 100644 --- a/runtime/platform/compiler.h +++ b/runtime/platform/compiler.h @@ -31,13 +31,11 @@ "You're trying to build ExecuTorch with a too old version of Clang. We need Clang 5 or later." #endif -// C++17 check #if (defined(_MSC_VER) && (!defined(_MSVC_LANG) || _MSVC_LANG < 201703L)) || \ (!defined(_MSC_VER) && __cplusplus < 201703L) #error "You need C++17 to compile ExecuTorch" #endif -// Windows min/max macro clash #if defined(_MSC_VER) && (defined(min) || defined(max)) #error \ "Macro clash with min and max -- define NOMINMAX when compiling your program on Windows" @@ -58,20 +56,6 @@ #define ET_NORETURN [[noreturn]] -#define ET_DEPRECATED [[deprecated]] -#define ET_EXPERIMENTAL \ - [[deprecated("This API is experimental and may change without notice.")]] - -#if defined(__clang__) || (defined(__GNUC__) && __GNUC__ >= 7) -#define ET_FALLTHROUGH [[fallthrough]] -#else -#define ET_FALLTHROUGH -#endif - -#define ET_NODISCARD [[nodiscard]] - -#define ET_UNUSED [[maybe_unused]] - // Inline/NoInline #if defined(_MSC_VER) #define ET_NOINLINE __declspec(noinline) @@ -99,25 +83,35 @@ #endif // defined(__GNUC__) +#define ET_DEPRECATED [[deprecated]] +#define ET_EXPERIMENTAL \ + [[deprecated("This API is experimental and may change without notice.")]] +#define ET_FALLTHROUGH [[fallthrough]] +#define ET_NODISCARD [[nodiscard]] +#define ET_UNUSED [[maybe_unused]] + // UNLIKELY Macro // example // if ET_UNLIKELY(a > 10 && b < 5) { // do something // } #if (__cplusplus) >= 202002L + #define ET_LIKELY(expr) (expr) [[likely]] #define ET_UNLIKELY(expr) (expr) [[unlikely]] + #else + #define ET_LIKELY(expr) (expr) #define ET_UNLIKELY(expr) (expr) -#endif + +#endif // (__cplusplus) >= 202002L /// Define a C symbol with weak linkage. #ifdef _MSC_VER // There currently doesn't seem to be a great way to do this in Windows and // given that weak linkage is not really critical on Windows, we'll just leave // it as a stub. -// No weak linkage in MSVC #define ET_WEAK #else #define ET_WEAK __attribute__((weak)) @@ -135,10 +129,6 @@ __attribute__((format(printf, _string_index, _va_index))) #endif -// ----------------------------------------------------------------------------- -// Builtin/Source location helpers -// ----------------------------------------------------------------------------- - #ifndef __has_builtin #define __has_builtin(x) (0) #endif @@ -175,15 +165,15 @@ // Whether the compiler supports GNU statement expressions. // https://gcc.gnu.org/onlinedocs/gcc/Statement-Exprs.html - #ifndef ET_HAVE_GNU_STATEMENT_EXPRESSIONS #if (defined(__GNUC__) && __GNUC__ >= 3) || defined(__clang__) #define ET_HAVE_GNU_STATEMENT_EXPRESSIONS 1 #else #define ET_HAVE_GNU_STATEMENT_EXPRESSIONS 0 #endif -#endif +#endif // ifndef +// Define size_t and ssize_t. #ifndef _MSC_VER #include #else @@ -201,7 +191,6 @@ using ssize_t = ptrdiff_t; // DEPRECATED: Use the non-underscore-prefixed versions instead. // TODO(T199005537): Remove these once all users have stopped using them. - #define __ET_DEPRECATED ET_DEPRECATED #define __ET_FALLTHROUGH ET_FALLTHROUGH #define __ET_FUNCTION ET_FUNCTION From fd4a247d5fbbe05ade43fcccd3bf849e137e3a26 Mon Sep 17 00:00:00 2001 From: Jacob Szwejbka Date: Thu, 16 Oct 2025 10:33:22 -0700 Subject: [PATCH 5/6] __forceinline is not an attribute --- runtime/platform/compiler.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/platform/compiler.h b/runtime/platform/compiler.h index af996e32967..2904d666609 100644 --- a/runtime/platform/compiler.h +++ b/runtime/platform/compiler.h @@ -60,7 +60,7 @@ #if defined(_MSC_VER) #define ET_NOINLINE __declspec(noinline) #define ET_INLINE __forceinline -#define ET_INLINE_ATTRIBUTE __forceinline +#define ET_INLINE_ATTRIBUTE #else #define ET_NOINLINE __attribute__((noinline)) #define ET_INLINE __attribute__((always_inline)) inline From e906d485d24e389085254182dd52183e532a4fc8 Mon Sep 17 00:00:00 2001 From: Jacob Szwejbka Date: Thu, 16 Oct 2025 10:40:36 -0700 Subject: [PATCH 6/6] Delete attribute --- runtime/platform/compiler.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/runtime/platform/compiler.h b/runtime/platform/compiler.h index 2904d666609..c970c12ea29 100644 --- a/runtime/platform/compiler.h +++ b/runtime/platform/compiler.h @@ -60,11 +60,9 @@ #if defined(_MSC_VER) #define ET_NOINLINE __declspec(noinline) #define ET_INLINE __forceinline -#define ET_INLINE_ATTRIBUTE #else #define ET_NOINLINE __attribute__((noinline)) #define ET_INLINE __attribute__((always_inline)) inline -#define ET_INLINE_ATTRIBUTE __attribute__((always_inline)) #endif #if defined(__GNUC__)