Skip to content

Commit fb65ecb

Browse files
committed
avutil: Fix linking x86 asm constants with Clang in MSVC mode
This fixes building with Clang in MSVC mode, for x86, which was broken in 6e49b86 (in Nov 2024); previously it failed with undefined symbols for the constants defined with DECLARE_ASM_CONST, accessed via inline assembly. Before 5786191, there was an #elif defined(__GNUC__) || defined(__clang__) case before the #elif defined(_MSC_VER) case for defining DECLARE_ASM_CONST, which included av_used. (This case included the explicit "defined(__clang__)" since f637046.) After 5786191, it used the generic definition of DECLARE_ASM_CONST that also included av_used - which also worked for Clang in MSVC mode. But after 6e49b86, Clang in MSVC mode ended up using the MSVC specific variant which lacked the av_used declaration, causing linker errors due to undefined symbols. Signed-off-by: Martin Storsjö <martin@martin.st>
1 parent 58f3d8a commit fb65ecb

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

libavutil/mem_internal.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@
8282
#define DECLARE_ASM_CONST(n,t,v) alignas(FFMIN(n, 16)) static const t av_used v
8383
#elif defined(_MSC_VER)
8484
#define DECLARE_ALIGNED_T(n,t,v) __declspec(align(n)) t v
85-
#define DECLARE_ASM_ALIGNED(n,t,v) __declspec(align(n)) t v
86-
#define DECLARE_ASM_CONST(n,t,v) __declspec(align(n)) static const t v
85+
#define DECLARE_ASM_ALIGNED(n,t,v) __declspec(align(n)) t av_used v
86+
#define DECLARE_ASM_CONST(n,t,v) __declspec(align(n)) static const t av_used v
8787
#else
8888
#define DECLARE_ALIGNED_T(n,t,v) alignas(n) t v
8989
#define DECLARE_ASM_ALIGNED(n,t,v) alignas(n) t av_used v

0 commit comments

Comments
 (0)