[FFmpeg-cvslog] msvc: Move linker pragma from config.h to libavutil/internal.h

Martin Storsjö git at videolan.org
Wed May 8 14:41:27 CEST 2013


ffmpeg | branch: master | Martin Storsjö <martin at martin.st> | Mon May  6 23:08:41 2013 +0300| [06122c253394b10a694d3d95e00e503c89852134] | committer: Martin Storsjö

msvc: Move linker pragma from config.h to libavutil/internal.h

This makes linking succeed for tools that include config.h but
don't link to libavutil.

Signed-off-by: Martin Storsjö <martin at martin.st>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=06122c253394b10a694d3d95e00e503c89852134
---

 configure            |    5 -----
 libavutil/internal.h |    5 +++++
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/configure b/configure
index 44e6262..d854519 100755
--- a/configure
+++ b/configure
@@ -4089,11 +4089,6 @@ fi
 
 enabled getenv || echo "#define getenv(x) NULL" >> $TMPH
 
-if enabled msvc && ! enabled shared; then
-    echo '#pragma comment(linker, "/include:"EXTERN_PREFIX"avpriv_strtod")' >> $TMPH
-    echo '#pragma comment(linker, "/include:"EXTERN_PREFIX"avpriv_snprintf")' >> $TMPH
-fi
-
 print_config ARCH_   "$config_files" $ARCH_LIST
 print_config HAVE_   "$config_files" $HAVE_LIST
 print_config CONFIG_ "$config_files" $CONFIG_LIST       \
diff --git a/libavutil/internal.h b/libavutil/internal.h
index 5f4b060..49534d4 100644
--- a/libavutil/internal.h
+++ b/libavutil/internal.h
@@ -111,6 +111,11 @@
 
 #include "libm.h"
 
+#if defined(_MSC_VER) && !CONFIG_SHARED
+#pragma comment(linker, "/include:"EXTERN_PREFIX"avpriv_strtod")
+#pragma comment(linker, "/include:"EXTERN_PREFIX"avpriv_snprintf")
+#endif
+
 /**
  * Return NULL if CONFIG_SMALL is true, otherwise the argument
  * without modification. Used to disable the definition of strings



More information about the ffmpeg-cvslog mailing list