X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=m4%2Fwmemcmp.m4;h=3b9e3f1612a71f67b89fb0d4f2ef6dfc3e901643;hb=55b2f23f298f16802baf844d9dd150dba298fd00;hp=ec86e422222ea3cc62e080f680348bf44434c682;hpb=abc17284134fd97bb3f734f2c7e9afa040956118;p=gnulib.git diff --git a/m4/wmemcmp.m4 b/m4/wmemcmp.m4 index ec86e4222..3b9e3f161 100644 --- a/m4/wmemcmp.m4 +++ b/m4/wmemcmp.m4 @@ -1,5 +1,5 @@ -# wmemcmp.m4 serial 2 -dnl Copyright (C) 2011 Free Software Foundation, Inc. +# wmemcmp.m4 serial 3 +dnl Copyright (C) 2011-2012 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,8 +7,26 @@ dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_FUNC_WMEMCMP], [ AC_REQUIRE([gl_WCHAR_H_DEFAULTS]) - AC_CHECK_FUNCS_ONCE([wmemcmp]) - if test $ac_cv_func_wmemcmp = 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 wmemcmp], [gl_cv_func_wmemcmp], + [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 ! wmemcmp ((const wchar_t *) 0, (const wchar_t *) 0, 0);]]) + ], + [gl_cv_func_wmemcmp=yes], + [gl_cv_func_wmemcmp=no]) + ]) + if test $gl_cv_func_wmemcmp = no; then HAVE_WMEMCMP=0 fi ])