Commit 3152058b authored by Martin Storsjö's avatar Martin Storsjö

libavcodec: Don't use dllexport, only dllimport when building DLLs

The only purpose of dllexport (which is set while building the library
that exports the symbols) is to have the linker automatically
export such symbols into a DLL without using a def file - it doesn't
affect the generated code.

For both MSVC and mingw builds, this isn't essential since we override
what symbols to export via an autogenerated def file instead.

Update a comment in configure to refer to the right concept.

With lld, this avoids warnings about duplicate export directives,
when some symbols are requested to be exported both via dllexport
attributes and via the autogenerated def file.

This also reduces the number of lines of code marginally.
Signed-off-by: 's avatarMartin Storsjö <martin@martin.st>
parent bad7ce1d
......@@ -3883,7 +3883,7 @@ case $target_os in
mingw32*|mingw64*)
target_os=mingw32
if enabled shared; then
# Cannot build both shared and static libs when using dllexport.
# Cannot build both shared and static libs when using dllimport.
disable static
fi
check_ldflags -Wl,--nxcompat
......
......@@ -285,12 +285,8 @@ int ff_decode_frame_props(AVCodecContext *avctx, AVFrame *frame);
*/
AVCPBProperties *ff_add_cpb_side_data(AVCodecContext *avctx);
#if defined(_WIN32) && CONFIG_SHARED
#ifdef BUILDING_avcodec
# define av_export_avcodec __declspec(dllexport)
#else
#if defined(_WIN32) && CONFIG_SHARED && !defined(BUILDING_avcodec)
# define av_export_avcodec __declspec(dllimport)
#endif
#else
# define av_export_avcodec
#endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment