diff options
author | Derek Buitenhuis <derek.buitenhuis@gmail.com> | 2013-07-19 22:25:57 +0400 |
---|---|---|
committer | Derek Buitenhuis <derek.buitenhuis@gmail.com> | 2013-07-21 16:56:25 +0400 |
commit | 4719040cd1b54381796b22056a9ae37bd2b4668d (patch) | |
tree | 8cfbc2cfd22f12deba981361078e23e7516ecfb3 | |
parent | fd8189932147a524fe43532b46baa35e8be92a1b (diff) |
libx264: Define X264_API_IMPORTS on MSVC/ICL
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 compiler
will first try and link to __imp_x264_symbol_name, and failing
that, as in the case of a static libx264, will attempt to link
to the non-prefixed symbol, which has already been pulled in by
other x264 functions' object files.
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
-rw-r--r-- | libavcodec/libx264.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c index bb92110801..665b31e36c 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> |