X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=m4%2Fwmemset.m4;h=9218226e0e5cd7ecca919b9e4c1dad3a3ad26002;hb=5bf73fbe89c75118e5e9a53e4b88a57729d26964;hp=9674c1242b8af651d36baf4d51a059bd48d0572f;hpb=485d6733ec4255ae5679fcc495c52de81234cc69;p=gnulib.git diff --git a/m4/wmemset.m4 b/m4/wmemset.m4 index 9674c1242..9218226e0 100644 --- a/m4/wmemset.m4 +++ b/m4/wmemset.m4 @@ -1,4 +1,4 @@ -# wmemset.m4 serial 2 +# wmemset.m4 serial 3 dnl Copyright (C) 2011 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -7,8 +7,26 @@ dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_FUNC_WMEMSET], [ AC_REQUIRE([gl_WCHAR_H_DEFAULTS]) - AC_CHECK_FUNCS_ONCE([wmemset]) - if test $ac_cv_func_wmemset = no; then + dnl We cannot use AC_CHECK_FUNCS here, because the MSVC 9 header files + dnl provide this function as an inline function definition. + AC_CACHE_CHECK([for wmemset], [gl_cv_func_wmemset], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[ +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be included + before . */ +#include +#include +#include +#include +]], + [[return ! wmemset ((wchar_t *) 0, (wchar_t) ' ', 0);]]) + ], + [gl_cv_func_wmemset=yes], + [gl_cv_func_wmemset=no]) + ]) + if test $gl_cv_func_wmemset = no; then HAVE_WMEMSET=0 fi ])