Skip a variable indirection and only redefine restrict if necessary.
---
Should still work on MSVC 2010 now as I don't kill the ugly workaround.
configure | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/configure b/configure
index 5684bddf9e..17acc98962 100755
--- a/configure
+++ b/configure
@@ -4134,9 +4134,8 @@ extern_prefix=${sym%%ff_extern*}
! disabled inline_asm && check_inline_asm inline_asm '"" ::'
-_restrict=
for restrict_keyword in restrict __restrict__ __restrict; do
- check_cc <<EOF && _restrict=$restrict_keyword && break
+ check_cc <<EOF && break
void foo(char * $restrict_keyword p);
EOF
done
@@ -4959,7 +4958,7 @@ elif enabled_any msvc icl; then
# MSVC 2013 and newer can handle it fine.
# If this declspec fails, force including stdlib.h before the restrict
redefinition
# happens in config.h.
- if [ $_restrict != restrict ]; then
+ if [ $restrict_keyword != restrict ]; then
check_cc <<EOF || add_cflags -FIstdlib.h
__declspec($_restrict) void* foo(int);
EOF
@@ -5318,12 +5317,14 @@ cat > $TMPH <<EOF
#define LIBAV_LICENSE "$(c_escape $license)"
#define AVCONV_DATADIR "$(eval c_escape $datadir)"
#define CC_IDENT "$(c_escape ${cc_ident:-Unknown compiler})"
-#define restrict $_restrict
#define EXTERN_PREFIX "${extern_prefix}"
#define EXTERN_ASM ${extern_prefix}
#define SLIBSUF "$SLIBSUF"
EOF
+test $restrict_keyword != restrict &&
+ echo "#define restrict $_restrict" >> $TMPH
+
test -n "$malloc_prefix" &&
echo "#define MALLOC_PREFIX $malloc_prefix" >>$TMPH
--
2.11.0
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel