On Thu, 12 Dec 2013, Diego Biurrun wrote:

MinGW* requires this to recognize some C99 printf format length modifiers.
---

This is not exactly pretty.  I'm all ears wrt cleaner solutions.

configure              | 6 +++++-
libavutil/attributes.h | 4 +++-
2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/configure b/configure
index 87ab32a..c32c902 100755
--- a/configure
+++ b/configure
@@ -1580,7 +1580,7 @@ need_memalign="altivec neon sse"

# system capabilities
log2_deps="!libc_msvcrt"
-
+printf_format="__printf__"
symver_if_any="symver_asm_label symver_gnu_asm"

# subsystems
@@ -3452,6 +3452,9 @@ case $libc_type in
    bionic)
        add_compat strtod.o strtod=avpriv_strtod
        ;;
+    mingw*)
+        printf_format="__MINGW_PRINTF_FORMAT"
+        ;;
    msvcrt)
        add_compat strtod.o strtod=avpriv_strtod
        add_compat msvcrt/snprintf.o snprintf=avpriv_snprintf   \
@@ -4434,6 +4437,7 @@ cat > $TMPH <<EOF
EOF

print_config AV_HAVE_ $TMPH $HAVE_LIST_PUB
+echo "#define AV_PRINTF_FORMAT $printf_format" >> $TMPH

echo "#endif /* AVUTIL_AVCONFIG_H */" >> $TMPH

This define depends on the compiler itself, which isn't acceptable in avconfig.h - the lib could be built with one compiler but the installed lib could be called from code built by another compiler that has a different preference for this attribute - thus, not ok to fix in avconfig.h. If the attribute should be changed (or anything else in public, installed headers), they can't use anything from the configure tests but can only use preprocessor conditions from the actual env where the header is used.

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

Reply via email to