msvc: Move linker pragma from config.h to libavutil/internal.h
authorMartin Storsjö <martin@martin.st>
Mon, 6 May 2013 20:08:41 +0000 (23:08 +0300)
committerMartin Storsjö <martin@martin.st>
Tue, 7 May 2013 22:28:25 +0000 (01:28 +0300)
This makes linking succeed for tools that include config.h but
don't link to libavutil.

Signed-off-by: Martin Storsjö <martin@martin.st>
configure
libavutil/internal.h

index 44e6262..d854519 100755 (executable)
--- 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       \
index 5f4b060..49534d4 100644 (file)
 
 #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