diff --git a/internal/cgen/base/fundamental-public.h b/internal/cgen/base/fundamental-public.h index 91a3fffe..c3965eb7 100644 --- a/internal/cgen/base/fundamental-public.h +++ b/internal/cgen/base/fundamental-public.h @@ -293,9 +293,15 @@ wuffs_base__cpu_arch__have_x86_sse42(void) { // The "defined(__clang__)" isn't redundant. While vanilla clang defines // __GNUC__, clang-cl (which mimics MSVC's cl.exe) does not. #if defined(__GNUC__) || defined(__clang__) +#define WUFFS_BASE__FORCE_INLINE __attribute__((__always_inline__)) #define WUFFS_BASE__POTENTIALLY_UNUSED __attribute__((unused)) #define WUFFS_BASE__WARN_UNUSED_RESULT __attribute__((warn_unused_result)) +#elif defined(_MSC_VER) +#define WUFFS_BASE__FORCE_INLINE __forceinline +#define WUFFS_BASE__POTENTIALLY_UNUSED +#define WUFFS_BASE__WARN_UNUSED_RESULT #else +#define WUFFS_BASE__FORCE_INLINE #define WUFFS_BASE__POTENTIALLY_UNUSED #define WUFFS_BASE__WARN_UNUSED_RESULT #endif diff --git a/internal/cgen/base/pixconv-submodule-regular.c b/internal/cgen/base/pixconv-submodule-regular.c index bac14e02..a4d83f5b 100644 --- a/internal/cgen/base/pixconv-submodule-regular.c +++ b/internal/cgen/base/pixconv-submodule-regular.c @@ -4799,7 +4799,7 @@ wuffs_private_impl__swizzle_transparent_black_src_over( // -------- -static wuffs_base__pixel_swizzler__func // +static inline WUFFS_BASE__FORCE_INLINE wuffs_base__pixel_swizzler__func // wuffs_private_impl__pixel_swizzler__prepare__y( wuffs_base__pixel_swizzler* p, wuffs_base__pixel_format dst_pixfmt, @@ -4841,7 +4841,7 @@ wuffs_private_impl__pixel_swizzler__prepare__y( return NULL; } -static wuffs_base__pixel_swizzler__func // +static inline WUFFS_BASE__FORCE_INLINE wuffs_base__pixel_swizzler__func // wuffs_private_impl__pixel_swizzler__prepare__y_16be( wuffs_base__pixel_swizzler* p, wuffs_base__pixel_format dst_pixfmt, @@ -4884,7 +4884,7 @@ wuffs_private_impl__pixel_swizzler__prepare__y_16be( return NULL; } -static wuffs_base__pixel_swizzler__func // +static inline WUFFS_BASE__FORCE_INLINE wuffs_base__pixel_swizzler__func // wuffs_private_impl__pixel_swizzler__prepare__ya_nonpremul( wuffs_base__pixel_swizzler* p, wuffs_base__pixel_format dst_pixfmt, @@ -4953,7 +4953,7 @@ wuffs_private_impl__pixel_swizzler__prepare__ya_nonpremul( return NULL; } -static wuffs_base__pixel_swizzler__func // +static inline WUFFS_BASE__FORCE_INLINE wuffs_base__pixel_swizzler__func // wuffs_private_impl__pixel_swizzler__prepare__indexed__bgra_nonpremul( wuffs_base__pixel_swizzler* p, wuffs_base__pixel_format dst_pixfmt, @@ -5125,7 +5125,7 @@ wuffs_private_impl__pixel_swizzler__prepare__indexed__bgra_nonpremul( return NULL; } -static wuffs_base__pixel_swizzler__func // +static inline WUFFS_BASE__FORCE_INLINE wuffs_base__pixel_swizzler__func // wuffs_private_impl__pixel_swizzler__prepare__indexed__bgra_binary( wuffs_base__pixel_swizzler* p, wuffs_base__pixel_format dst_pixfmt, @@ -5242,7 +5242,7 @@ wuffs_private_impl__pixel_swizzler__prepare__indexed__bgra_binary( return NULL; } -static wuffs_base__pixel_swizzler__func // +static inline WUFFS_BASE__FORCE_INLINE wuffs_base__pixel_swizzler__func // wuffs_private_impl__pixel_swizzler__prepare__bgr_565( wuffs_base__pixel_swizzler* p, wuffs_base__pixel_format dst_pixfmt, @@ -5278,7 +5278,7 @@ wuffs_private_impl__pixel_swizzler__prepare__bgr_565( return NULL; } -static wuffs_base__pixel_swizzler__func // +static inline WUFFS_BASE__FORCE_INLINE wuffs_base__pixel_swizzler__func // wuffs_private_impl__pixel_swizzler__prepare__bgr( wuffs_base__pixel_swizzler* p, wuffs_base__pixel_format dst_pixfmt, @@ -5324,7 +5324,7 @@ wuffs_private_impl__pixel_swizzler__prepare__bgr( return NULL; } -static wuffs_base__pixel_swizzler__func // +static inline WUFFS_BASE__FORCE_INLINE wuffs_base__pixel_swizzler__func // wuffs_private_impl__pixel_swizzler__prepare__bgra_nonpremul( wuffs_base__pixel_swizzler* p, wuffs_base__pixel_format dst_pixfmt, @@ -5422,7 +5422,7 @@ wuffs_private_impl__pixel_swizzler__prepare__bgra_nonpremul( return NULL; } -static wuffs_base__pixel_swizzler__func // +static inline WUFFS_BASE__FORCE_INLINE wuffs_base__pixel_swizzler__func // wuffs_private_impl__pixel_swizzler__prepare__bgra_nonpremul_4x16le( wuffs_base__pixel_swizzler* p, wuffs_base__pixel_format dst_pixfmt, @@ -5515,7 +5515,7 @@ wuffs_private_impl__pixel_swizzler__prepare__bgra_nonpremul_4x16le( return NULL; } -static wuffs_base__pixel_swizzler__func // +static inline WUFFS_BASE__FORCE_INLINE wuffs_base__pixel_swizzler__func // wuffs_private_impl__pixel_swizzler__prepare__bgra_premul( wuffs_base__pixel_swizzler* p, wuffs_base__pixel_format dst_pixfmt, @@ -5603,7 +5603,7 @@ wuffs_private_impl__pixel_swizzler__prepare__bgra_premul( return NULL; } -static wuffs_base__pixel_swizzler__func // +static inline WUFFS_BASE__FORCE_INLINE wuffs_base__pixel_swizzler__func // wuffs_private_impl__pixel_swizzler__prepare__bgrx( wuffs_base__pixel_swizzler* p, wuffs_base__pixel_format dst_pixfmt, @@ -5640,7 +5640,7 @@ wuffs_private_impl__pixel_swizzler__prepare__bgrx( return NULL; } -static wuffs_base__pixel_swizzler__func // +static inline WUFFS_BASE__FORCE_INLINE wuffs_base__pixel_swizzler__func // wuffs_private_impl__pixel_swizzler__prepare__rgb( wuffs_base__pixel_swizzler* p, wuffs_base__pixel_format dst_pixfmt, @@ -5685,7 +5685,7 @@ wuffs_private_impl__pixel_swizzler__prepare__rgb( return NULL; } -static wuffs_base__pixel_swizzler__func // +static inline WUFFS_BASE__FORCE_INLINE wuffs_base__pixel_swizzler__func // wuffs_private_impl__pixel_swizzler__prepare__rgba_nonpremul( wuffs_base__pixel_swizzler* p, wuffs_base__pixel_format dst_pixfmt, @@ -5783,7 +5783,7 @@ wuffs_private_impl__pixel_swizzler__prepare__rgba_nonpremul( return NULL; } -static wuffs_base__pixel_swizzler__func // +static inline WUFFS_BASE__FORCE_INLINE wuffs_base__pixel_swizzler__func // wuffs_private_impl__pixel_swizzler__prepare__rgba_premul( wuffs_base__pixel_swizzler* p, wuffs_base__pixel_format dst_pixfmt, diff --git a/release/c/wuffs-unsupported-snapshot.c b/release/c/wuffs-unsupported-snapshot.c index 5196dc2e..36537c7e 100644 --- a/release/c/wuffs-unsupported-snapshot.c +++ b/release/c/wuffs-unsupported-snapshot.c @@ -349,9 +349,15 @@ wuffs_base__cpu_arch__have_x86_sse42(void) { // The "defined(__clang__)" isn't redundant. While vanilla clang defines // __GNUC__, clang-cl (which mimics MSVC's cl.exe) does not. #if defined(__GNUC__) || defined(__clang__) +#define WUFFS_BASE__FORCE_INLINE __attribute__((__always_inline__)) #define WUFFS_BASE__POTENTIALLY_UNUSED __attribute__((unused)) #define WUFFS_BASE__WARN_UNUSED_RESULT __attribute__((warn_unused_result)) +#elif defined(_MSC_VER) +#define WUFFS_BASE__FORCE_INLINE __forceinline +#define WUFFS_BASE__POTENTIALLY_UNUSED +#define WUFFS_BASE__WARN_UNUSED_RESULT #else +#define WUFFS_BASE__FORCE_INLINE #define WUFFS_BASE__POTENTIALLY_UNUSED #define WUFFS_BASE__WARN_UNUSED_RESULT #endif @@ -25769,7 +25775,7 @@ wuffs_private_impl__swizzle_transparent_black_src_over( // -------- -static wuffs_base__pixel_swizzler__func // +static inline WUFFS_BASE__FORCE_INLINE wuffs_base__pixel_swizzler__func // wuffs_private_impl__pixel_swizzler__prepare__y( wuffs_base__pixel_swizzler* p, wuffs_base__pixel_format dst_pixfmt, @@ -25811,7 +25817,7 @@ wuffs_private_impl__pixel_swizzler__prepare__y( return NULL; } -static wuffs_base__pixel_swizzler__func // +static inline WUFFS_BASE__FORCE_INLINE wuffs_base__pixel_swizzler__func // wuffs_private_impl__pixel_swizzler__prepare__y_16be( wuffs_base__pixel_swizzler* p, wuffs_base__pixel_format dst_pixfmt, @@ -25854,7 +25860,7 @@ wuffs_private_impl__pixel_swizzler__prepare__y_16be( return NULL; } -static wuffs_base__pixel_swizzler__func // +static inline WUFFS_BASE__FORCE_INLINE wuffs_base__pixel_swizzler__func // wuffs_private_impl__pixel_swizzler__prepare__ya_nonpremul( wuffs_base__pixel_swizzler* p, wuffs_base__pixel_format dst_pixfmt, @@ -25923,7 +25929,7 @@ wuffs_private_impl__pixel_swizzler__prepare__ya_nonpremul( return NULL; } -static wuffs_base__pixel_swizzler__func // +static inline WUFFS_BASE__FORCE_INLINE wuffs_base__pixel_swizzler__func // wuffs_private_impl__pixel_swizzler__prepare__indexed__bgra_nonpremul( wuffs_base__pixel_swizzler* p, wuffs_base__pixel_format dst_pixfmt, @@ -26095,7 +26101,7 @@ wuffs_private_impl__pixel_swizzler__prepare__indexed__bgra_nonpremul( return NULL; } -static wuffs_base__pixel_swizzler__func // +static inline WUFFS_BASE__FORCE_INLINE wuffs_base__pixel_swizzler__func // wuffs_private_impl__pixel_swizzler__prepare__indexed__bgra_binary( wuffs_base__pixel_swizzler* p, wuffs_base__pixel_format dst_pixfmt, @@ -26212,7 +26218,7 @@ wuffs_private_impl__pixel_swizzler__prepare__indexed__bgra_binary( return NULL; } -static wuffs_base__pixel_swizzler__func // +static inline WUFFS_BASE__FORCE_INLINE wuffs_base__pixel_swizzler__func // wuffs_private_impl__pixel_swizzler__prepare__bgr_565( wuffs_base__pixel_swizzler* p, wuffs_base__pixel_format dst_pixfmt, @@ -26248,7 +26254,7 @@ wuffs_private_impl__pixel_swizzler__prepare__bgr_565( return NULL; } -static wuffs_base__pixel_swizzler__func // +static inline WUFFS_BASE__FORCE_INLINE wuffs_base__pixel_swizzler__func // wuffs_private_impl__pixel_swizzler__prepare__bgr( wuffs_base__pixel_swizzler* p, wuffs_base__pixel_format dst_pixfmt, @@ -26294,7 +26300,7 @@ wuffs_private_impl__pixel_swizzler__prepare__bgr( return NULL; } -static wuffs_base__pixel_swizzler__func // +static inline WUFFS_BASE__FORCE_INLINE wuffs_base__pixel_swizzler__func // wuffs_private_impl__pixel_swizzler__prepare__bgra_nonpremul( wuffs_base__pixel_swizzler* p, wuffs_base__pixel_format dst_pixfmt, @@ -26392,7 +26398,7 @@ wuffs_private_impl__pixel_swizzler__prepare__bgra_nonpremul( return NULL; } -static wuffs_base__pixel_swizzler__func // +static inline WUFFS_BASE__FORCE_INLINE wuffs_base__pixel_swizzler__func // wuffs_private_impl__pixel_swizzler__prepare__bgra_nonpremul_4x16le( wuffs_base__pixel_swizzler* p, wuffs_base__pixel_format dst_pixfmt, @@ -26485,7 +26491,7 @@ wuffs_private_impl__pixel_swizzler__prepare__bgra_nonpremul_4x16le( return NULL; } -static wuffs_base__pixel_swizzler__func // +static inline WUFFS_BASE__FORCE_INLINE wuffs_base__pixel_swizzler__func // wuffs_private_impl__pixel_swizzler__prepare__bgra_premul( wuffs_base__pixel_swizzler* p, wuffs_base__pixel_format dst_pixfmt, @@ -26573,7 +26579,7 @@ wuffs_private_impl__pixel_swizzler__prepare__bgra_premul( return NULL; } -static wuffs_base__pixel_swizzler__func // +static inline WUFFS_BASE__FORCE_INLINE wuffs_base__pixel_swizzler__func // wuffs_private_impl__pixel_swizzler__prepare__bgrx( wuffs_base__pixel_swizzler* p, wuffs_base__pixel_format dst_pixfmt, @@ -26610,7 +26616,7 @@ wuffs_private_impl__pixel_swizzler__prepare__bgrx( return NULL; } -static wuffs_base__pixel_swizzler__func // +static inline WUFFS_BASE__FORCE_INLINE wuffs_base__pixel_swizzler__func // wuffs_private_impl__pixel_swizzler__prepare__rgb( wuffs_base__pixel_swizzler* p, wuffs_base__pixel_format dst_pixfmt, @@ -26655,7 +26661,7 @@ wuffs_private_impl__pixel_swizzler__prepare__rgb( return NULL; } -static wuffs_base__pixel_swizzler__func // +static inline WUFFS_BASE__FORCE_INLINE wuffs_base__pixel_swizzler__func // wuffs_private_impl__pixel_swizzler__prepare__rgba_nonpremul( wuffs_base__pixel_swizzler* p, wuffs_base__pixel_format dst_pixfmt, @@ -26753,7 +26759,7 @@ wuffs_private_impl__pixel_swizzler__prepare__rgba_nonpremul( return NULL; } -static wuffs_base__pixel_swizzler__func // +static inline WUFFS_BASE__FORCE_INLINE wuffs_base__pixel_swizzler__func // wuffs_private_impl__pixel_swizzler__prepare__rgba_premul( wuffs_base__pixel_swizzler* p, wuffs_base__pixel_format dst_pixfmt,