diff options
| author | Tim Redfern <tim@eclectronics.org> | 2013-12-29 12:19:38 +0000 |
|---|---|---|
| committer | Tim Redfern <tim@eclectronics.org> | 2013-12-29 12:19:38 +0000 |
| commit | f7813a5324be39d13ab536c245d15dfc602a7849 (patch) | |
| tree | fad99148b88823d34a5df2f0a25881a002eb291b /ffmpeg/libavcodec/tableprint.h | |
| parent | b7a5a477b8ff4d4e3028b9dfb9a9df0a41463f92 (diff) | |
basic type mechanism working
Diffstat (limited to 'ffmpeg/libavcodec/tableprint.h')
| -rw-r--r-- | ffmpeg/libavcodec/tableprint.h | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/ffmpeg/libavcodec/tableprint.h b/ffmpeg/libavcodec/tableprint.h index 1b39dc6..26d063e 100644 --- a/ffmpeg/libavcodec/tableprint.h +++ b/ffmpeg/libavcodec/tableprint.h @@ -71,10 +71,20 @@ void write_uint32_t_2d_array(const void *, int, int); void write_float_2d_array (const void *, int, int); /** @} */ // 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"); \ @@ -84,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"); \ |
