libx264 has a few data exports which require X264_API_IMPORTS
to be defined if we link to libx264 dynamically on Windows.

In a similar fashion to how we handle our compat snprintf
implementation, if we define it all the time, the
__declspec(dllimport) will be ignored by the compiler when it
isn't needed, and print a warning instead.

Signed-off-by: Derek Buitenhuis <[email protected]>
---
Tested on with MSVC 2012 and ICL 2013 XE.

Comments and flames welcome.
---
 libavcodec/libx264.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c
index bb92110..665b31e 100644
--- a/libavcodec/libx264.c
+++ b/libavcodec/libx264.c
@@ -25,6 +25,11 @@
 #include "libavutil/pixdesc.h"
 #include "avcodec.h"
 #include "internal.h"
+
+#if defined(_MSC_VER)
+#define X264_API_IMPORTS 1
+#endif
+
 #include <x264.h>
 #include <float.h>
 #include <math.h>
-- 
1.8.3.2

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to