ff_socket: put out-of-line and fallback to fcntl() for close-on-exec

This supports non-Linux systems (SOCK_CLOEXEC is non-standard) and
older Linux kernels to the extent possible.

Signed-off-by: Martin Storsjö <martin@martin.st>
libavutil: Enable the MSVC DLL symbol loading workaround in shared builds as well

This used to only be necessary in static builds (when using the
dynamically linked C runtime), since the _imp prefixed symbols do
exist when linking to the actual DLL. When building testprogs,
however, the current library (e.g. libavutil for some of the testprogs)
is linked statically.

This fixes make fate on DLL builds when using the dynamically
linked C runtime.

Signed-off-by: Martin Storsjö <martin@martin.st>
bktr: Changed a missed occurrance of open into avpriv_open

Signed-off-by: Martin Storsjö <martin@martin.st>
libavutil: Move avpriv_open to a new file, file_open.c

Signed-off-by: Martin Storsjö <martin@martin.st>
libavutil: Make avpriv_open a library-internal function on msvcrt

Add one copy of the function into each of the libraries, similarly
to what we do for log2_tab. When using static libs, only one
copy of the file_open.o object file gets included, while when
using shared libraries, each of them get a copy of its own.

This fixes DLL builds with a statically linked C runtime, where
each DLL effectively has got its own instance of the C runtime,
where file descriptors can't be shared across runtimes.

On systems not using msvcrt, the function is not duplicated.

Signed-off-by: Martin Storsjö <martin@martin.st>
Merge commit '9d5ec50ead97e088d77317e77b18cef06cb3d053'

* commit '9d5ec50ead97e088d77317e77b18cef06cb3d053':
  ff_socket: put out-of-line and fallback to fcntl() for close-on-exec

Conflicts:
	libavformat/network.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
Merge commit '33237123c83bf4f8345e6ac889ad2e7dbd303d0e'

* commit '33237123c83bf4f8345e6ac889ad2e7dbd303d0e':
  libavutil: Enable the MSVC DLL symbol loading workaround in shared builds as well

Merged-by: Michael Niedermayer <michaelni@gmx.at>
Merge commit 'cb0244daaca83ab666798818f74f5181bf6bc387'

* commit 'cb0244daaca83ab666798818f74f5181bf6bc387':
  bktr: Changed a missed occurrance of open into avpriv_open

Merged-by: Michael Niedermayer <michaelni@gmx.at>
Merge commit 'a76d0cdf21c3d9e464623cc0ad1c005abf952afa'

* commit 'a76d0cdf21c3d9e464623cc0ad1c005abf952afa':
  libavutil: Move avpriv_open to a new file, file_open.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
Merge remote-tracking branch 'qatar/master'

* qatar/master:
  libavutil: Make avpriv_open a library-internal function on msvcrt

Merged-by: Michael Niedermayer <michaelni@gmx.at>
avutil/bprint: add av_vbprintf()

Reviewed-by: Nicolas George <nicolas.george@normalesup.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>