clang on windows support

This commit is contained in:
wuggy 2026-09-10 08:32:59 -07:00
commit 1d44f05fba
22 changed files with 208 additions and 65 deletions

View file

@ -162,6 +162,13 @@ SOURCES += [
'xiph.c'
]
# dummy_funcs.c intentionally provides tentative definitions for FFmpeg
# objects that are disabled by the generated configuration. Clang's default
# -fno-common turns those placeholders into duplicate definitions when an
# enabled codec supplies the real object.
if CONFIG['CLANG_CL']:
SOURCES['dummy_funcs.c'].flags += ['-fcommon']
SYMBOLS_FILE = 'avcodec.symbols'
NO_VISIBILITY_FLAGS = True

View file

@ -41,7 +41,8 @@ static inline void atomic_int_set_win32(volatile int *ptr, int val)
#define avpriv_atomic_int_add_and_fetch atomic_int_add_and_fetch_win32
static inline int atomic_int_add_and_fetch_win32(volatile int *ptr, int inc)
{
return inc + InterlockedExchangeAdd(ptr, inc);
/* Windows int and LONG are both 32-bit, but have distinct C types. */
return inc + InterlockedExchangeAdd((volatile LONG *)ptr, inc);
}
#define avpriv_atomic_ptr_cas atomic_ptr_cas_win32