]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/tableprint.h
vaapi_h265: Convert to use coded bitstream infrastructure
[ffmpeg] / libavcodec / tableprint.h
index de355fc0aaa923d4d45944bc10c16414cdb48049..daa89fe99b7892216925988b0afbf5fecf7bd983 100644 (file)
@@ -26,6 +26,8 @@
 #include <inttypes.h>
 #include <stdio.h>
 
+#include "libavutil/common.h"
+
 #define WRITE_1D_FUNC_ARGV(type, linebrk, fmtstr, ...)\
 void write_##type##_array(const type *data, int len)\
 {\
@@ -54,9 +56,9 @@ void write_##type##_2d_array(const void *arg, int len, int len2)\
 }
 
 /**
- * \defgroup printfuncs Predefined functions for printing tables
+ * @name Predefined functions for printing tables
  *
- * \{
+ * @{
  */
 void write_int8_t_array     (const int8_t   *, int);
 void write_uint8_t_array    (const uint8_t  *, int);
@@ -67,12 +69,22 @@ void write_int8_t_2d_array  (const void *, int, int);
 void write_uint8_t_2d_array (const void *, int, int);
 void write_uint32_t_2d_array(const void *, int, int);
 void write_float_2d_array   (const void *, int, int);
-/** \} */ // end of printfuncs group
+/** @} */ // end of printfuncs group
+
+/*
+ * MSVC doesn't have %zu, since it was introduced in C99,
+ * but has its own %Iu for printing size_t values.
+ */
+#if defined(_MSC_VER)
+#define FMT "Iu"
+#else
+#define FMT "zu"
+#endif
 
 #define WRITE_ARRAY(prefix, type, name)                 \
     do {                                                \
         const size_t array_size = FF_ARRAY_ELEMS(name); \
-        printf(prefix" "#type" "#name"[%zu] = {\n",     \
+        printf(prefix" "#type" "#name"[%"FMT"] = {\n",  \
                array_size);                             \
         write_##type##_array(name, array_size);         \
         printf("};\n");                                 \
@@ -82,7 +94,7 @@ void write_float_2d_array   (const void *, int, int);
     do {                                                                \
         const size_t array_size1 = FF_ARRAY_ELEMS(name);                \
         const size_t array_size2 = FF_ARRAY_ELEMS(name[0]);             \
-        printf(prefix" "#type" "#name"[%zu][%zu] = {\n",                \
+        printf(prefix" "#type" "#name"[%"FMT"][%"FMT"] = {\n",          \
                array_size1, array_size2 );                              \
         write_##type##_2d_array(name, array_size1, array_size2);        \
         printf("};\n");                                                 \