[FFmpeg-devel] [PATCH 2/2] avutil/mem_internal: Don't include stdalign.h on MSVC
Zhao Zhili
quinkblack at foxmail.com
Tue Dec 17 15:44:10 EET 2024
> On Dec 17, 2024, at 21:13, Martin Storsjö <martin at martin.st> wrote:
>
> It's currently actually not used in MSVC builds, since
> 6e49b8699657b808b7dc80033f2c3f2d0e029fa3.
>
> Older versions of MSVC (or, in particular, older versions of UCRT)
> don't have stdalign.h; it's available since WinSDK 10.0.22000.0,
> shipped along with MSVC 2022 17.4 and newer.
>
> With this change, ffmpeg can still be built with MSVC 2019.
LGTM. I’m shocked that a not-so-outdated version of MSVC doesn’t have
stdalign.h.
> ---
> I'm not adamant on needing to support older versions of MSVC,
> but earlier times when we've raised the required version, it has
> been raised after an explicit discussion on it, while this requirement
> in 57861911a34e1c33796be97f2b2f44e05fffd647 came rather
> implicitly.
>
> E.g., last time this was bumped, in
> c00cd007e842b522dc9fbd219e6d32fe9212465b, the requirement was
> raised to v19.27 (MSVC 2019 16.7) and in
> 0d43adcbef9a061c95db60eb351937c27e2a0609 it was further nudged to
> require v19.28 (MSVC 2019 16.8).
>
> And since we don't actually use this header on MSVC at the moment,
> I thought we can reinstate support for building with older versions
> for now.
> ---
> libavutil/mem_internal.h | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/libavutil/mem_internal.h b/libavutil/mem_internal.h
> index 2eb4aef5b0..c027fa51c3 100644
> --- a/libavutil/mem_internal.h
> +++ b/libavutil/mem_internal.h
> @@ -24,7 +24,9 @@
> #include "config.h"
>
> #include <stdint.h>
> +#ifndef _MSC_VER
> #include <stdalign.h>
> +#endif
>
> #include "attributes.h"
> #include "macros.h"
> --
> 2.43.0
More information about the ffmpeg-devel
mailing list