X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=m4%2Ffree.m4;h=76bca667f2102a49b72d883c7d3d48e0af706716;hb=4752c7c4aaba4eca621082dc8042646f6efd71ec;hp=24bbbb184f195064392219e827ac19ffc26a1c14;hpb=ee6855ea0843b56e6d9c3d6abde368ab22e5befe;p=gnulib.git diff --git a/m4/free.m4 b/m4/free.m4 index 24bbbb184..76bca667f 100644 --- a/m4/free.m4 +++ b/m4/free.m4 @@ -16,18 +16,24 @@ AC_DEFUN([gl_FUNC_FREE], [ + AC_REQUIRE([AC_CANONICAL_HOST]) AC_CACHE_CHECK([whether free (NULL) is known to work], [gl_cv_func_free], - [AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM( - [[@%:@include ]], - [[@%:@if _POSIX_VERSION < 199009L && \ - (defined unix || defined _unix || defined _unix_ \ - || defined __unix || defined __unix__) - @%:@error "'free (NULL)' is not known to work" - @%:@endif]])], - [gl_cv_func_free=yes], - [gl_cv_func_free=no])]) + [case "$host_os" in + mingw*) gl_cv_func_free=yes ;; + *) + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[@%:@include ]], + [[@%:@if _POSIX_VERSION < 199009L && \ + (defined unix || defined _unix || defined _unix_ \ + || defined __unix || defined __unix__) + @%:@error "'free (NULL)' is not known to work" + @%:@endif]])], + [gl_cv_func_free=yes], + [gl_cv_func_free=no]) + esac + ]) if test $gl_cv_func_free = no; then AC_DEFINE([free], [rpl_free],