On Fri, 19 Jul 2013, Derek Buitenhuis wrote:

On 7/19/2013 2:47 PM, Martin Storsjö wrote:
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.

This section isn't quite accurate. The declaration is not ignored, but it
means that the linker will end up trying to link to __imp_x264_symbol_name
and not be able to find it, but will figure it out and do the right kind
of magic to make it match the x264_symbol_name it does find (and warn
about it). This magic only works if the object file that contains
x264_symbol_name is included in the link earlier by some other symbol.

"In a similar fashion to how we handle out compat snprintf

our

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."

Looks pretty good to me. I'm not sure if it's better to omit the reference to the compat hackery (it's better if it's just forgotten and never looked at again ;P) or to use it as example.

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

Reply via email to