X-Git-Url: https://erislabs.net/gitweb/?a=blobdiff_plain;ds=inline;f=m4%2Fwmemset.m4;h=7936c92fa3dd24887c2b264b23e3abbf388fad4c;hb=6b24f60dad0f97704ae07d9688de7f31c1923bf7;hp=1e960e394a4f62798e659cff60f596205e48568a;hpb=e4d07a05390c21a9df213e014efeaf6704593879;p=gnulib.git diff --git a/m4/wmemset.m4 b/m4/wmemset.m4 index 1e960e394..7936c92fa 100644 --- a/m4/wmemset.m4 +++ b/m4/wmemset.m4 @@ -1,5 +1,5 @@ -# wmemset.m4 serial 1 -dnl Copyright (C) 2011 Free Software Foundation, Inc. +# wmemset.m4 serial 3 +dnl Copyright (C) 2011-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -7,9 +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 - AC_LIBOBJ([wmemset]) fi ])