From e743e7ae6ee7e535c4394bec6fe6650d2b0dbf65 Mon Sep 17 00:00:00 2001 From: Martin Storsjö Date: Fri, 9 Aug 2013 11:06:46 +0300 Subject: libavutil: Make avpriv_open a library-internal function on msvcrt MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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ö --- libavdevice/Makefile | 2 ++ libavdevice/file_open.c | 1 + 2 files changed, 3 insertions(+) create mode 100644 libavdevice/file_open.c (limited to 'libavdevice') diff --git a/libavdevice/Makefile b/libavdevice/Makefile index 76d11c1f1c..8fdae2d44e 100644 --- a/libavdevice/Makefile +++ b/libavdevice/Makefile @@ -7,6 +7,8 @@ HEADERS = avdevice.h \ OBJS = alldevices.o \ avdevice.o \ +OBJS-$(HAVE_MSVCRT) += file_open.o + # input/output devices OBJS-$(CONFIG_ALSA_INDEV) += alsa-audio-common.o \ alsa-audio-dec.o diff --git a/libavdevice/file_open.c b/libavdevice/file_open.c new file mode 100644 index 0000000000..494a5d37a4 --- /dev/null +++ b/libavdevice/file_open.c @@ -0,0 +1 @@ +#include "libavutil/file_open.c" -- cgit v1.2.3