diff mbox series

[FFmpeg-devel] avcodec/ccaption_dec: Use static_assert instead of _Static_assert

Message ID AS8P250MB07448472952914B4E2C5AD418F282@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM
State Accepted
Commit 2a0194bafa62aee9217e6dc375243f96acec7088
Headers show
Series [FFmpeg-devel] avcodec/ccaption_dec: Use static_assert instead of _Static_assert | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Andreas Rheinhardt March 15, 2024, 11:46 a.m. UTC
The latter is not supported by MSVC 19.27.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavcodec/ccaption_dec.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

Comments

Andreas Rheinhardt March 17, 2024, 2:46 p.m. UTC | #1
Andreas Rheinhardt:
> The latter is not supported by MSVC 19.27.
> 
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
> ---
>  libavcodec/ccaption_dec.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/libavcodec/ccaption_dec.c b/libavcodec/ccaption_dec.c
> index faf058ce97..d8b992bb94 100644
> --- a/libavcodec/ccaption_dec.c
> +++ b/libavcodec/ccaption_dec.c
> @@ -19,6 +19,7 @@
>   * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
>   */
>  
> +#include <assert.h>
>  #include "avcodec.h"
>  #include "ass.h"
>  #include "codec_internal.h"
> @@ -180,9 +181,9 @@ static const char charset_overrides[4][128][sizeof("\u266a")] =
>  };
>  #define EMPTY_START(IDX)
>  #define EMPTY_END
> -#define ASSERT_ENTRY(IDX, str)                                     \
> -    _Static_assert(sizeof(str) <= sizeof(charset_overrides[0][0]), \
> -                   "'" str "' string takes too much space");
> +#define ASSERT_ENTRY(IDX, str)                                    \
> +    static_assert(sizeof(str) <= sizeof(charset_overrides[0][0]), \
> +                  "'" str "' string takes too much space");
>  CHARSET_OVERRIDE_LIST(EMPTY_START, ASSERT_ENTRY, EMPTY_END)
>  
>  static const unsigned char bg_attribs[8] = // Color

Will apply tomorrow unless there are objections.

- Andreas
diff mbox series

Patch

diff --git a/libavcodec/ccaption_dec.c b/libavcodec/ccaption_dec.c
index faf058ce97..d8b992bb94 100644
--- a/libavcodec/ccaption_dec.c
+++ b/libavcodec/ccaption_dec.c
@@ -19,6 +19,7 @@ 
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#include <assert.h>
 #include "avcodec.h"
 #include "ass.h"
 #include "codec_internal.h"
@@ -180,9 +181,9 @@  static const char charset_overrides[4][128][sizeof("\u266a")] =
 };
 #define EMPTY_START(IDX)
 #define EMPTY_END
-#define ASSERT_ENTRY(IDX, str)                                     \
-    _Static_assert(sizeof(str) <= sizeof(charset_overrides[0][0]), \
-                   "'" str "' string takes too much space");
+#define ASSERT_ENTRY(IDX, str)                                    \
+    static_assert(sizeof(str) <= sizeof(charset_overrides[0][0]), \
+                  "'" str "' string takes too much space");
 CHARSET_OVERRIDE_LIST(EMPTY_START, ASSERT_ENTRY, EMPTY_END)
 
 static const unsigned char bg_attribs[8] = // Color