aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorLuca Barbato <lu_zero@gentoo.org>2012-07-25 16:22:34 +0200
committerMartin Storsjö <martin@martin.st>2012-09-05 17:07:24 +0300
commit0db2d94280e260af5f3ad7993c5a6357462f17c9 (patch)
tree5eab6964513fea7c0e07eb70082cfc1a6ab3bd58 /libavcodec
parentb797f3c4d01e62b4db689d69bf417cced9099b06 (diff)
downloadffmpeg-0db2d94280e260af5f3ad7993c5a6357462f17c9.tar.gz
dsputil: workaround __VA_ARGS__ missing tokenization for MSVC
A second expansion forces the preprocessor to tokenize properly. Signed-off-by: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/dsputil.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/libavcodec/dsputil.h b/libavcodec/dsputil.h
index e47cd2cec2..bb70428e2a 100644
--- a/libavcodec/dsputil.h
+++ b/libavcodec/dsputil.h
@@ -622,22 +622,26 @@ void ff_mlp_init_x86(DSPContext* c, AVCodecContext *avctx);
# define STRIDE_ALIGN 8
#endif
+// Some broken preprocessors need a second expansion
+// to be forced to tokenize __VA_ARGS__
+#define E(x) x
+
#define LOCAL_ALIGNED_A(a, t, v, s, o, ...) \
uint8_t la_##v[sizeof(t s o) + (a)]; \
t (*v) o = (void *)FFALIGN((uintptr_t)la_##v, a)
#define LOCAL_ALIGNED_D(a, t, v, s, o, ...) DECLARE_ALIGNED(a, t, v) s o
-#define LOCAL_ALIGNED(a, t, v, ...) LOCAL_ALIGNED_A(a, t, v, __VA_ARGS__,,)
+#define LOCAL_ALIGNED(a, t, v, ...) E(LOCAL_ALIGNED_A(a, t, v, __VA_ARGS__,,))
#if HAVE_LOCAL_ALIGNED_8
-# define LOCAL_ALIGNED_8(t, v, ...) LOCAL_ALIGNED_D(8, t, v, __VA_ARGS__,,)
+# define LOCAL_ALIGNED_8(t, v, ...) E(LOCAL_ALIGNED_D(8, t, v, __VA_ARGS__,,))
#else
# define LOCAL_ALIGNED_8(t, v, ...) LOCAL_ALIGNED(8, t, v, __VA_ARGS__)
#endif
#if HAVE_LOCAL_ALIGNED_16
-# define LOCAL_ALIGNED_16(t, v, ...) LOCAL_ALIGNED_D(16, t, v, __VA_ARGS__,,)
+# define LOCAL_ALIGNED_16(t, v, ...) E(LOCAL_ALIGNED_D(16, t, v, __VA_ARGS__,,))
#else
# define LOCAL_ALIGNED_16(t, v, ...) LOCAL_ALIGNED(16, t, v, __VA_ARGS__)
#endif