diff options
author | Jim Meyering <jim@meyering.net> | 2000-07-06 04:46:48 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2000-07-06 04:46:48 +0000 |
commit | 4f23c0f185a36020855395d116084765cac44242 (patch) | |
tree | 1eb7e44192fe110f74126c4c7d6f964477f21ee8 | |
parent | 79ab392196147a1d5a4b220c1b035d9869e36f15 (diff) | |
download | coreutils-4f23c0f185a36020855395d116084765cac44242.tar.xz |
(AC_MBSTATE_T_OBJECT): Test for mbstate_t
only if the test for an object-type mbstate_t fails. This
prevents us from mistakenly reporting that mbstate_t is a
system object type after we "#define mbstate_t int" to work
around its lack.
-rw-r--r-- | m4/mbstate_t.m4 | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/m4/mbstate_t.m4 b/m4/mbstate_t.m4 index 693613324..ac47f11b2 100644 --- a/m4/mbstate_t.m4 +++ b/m4/mbstate_t.m4 @@ -1,4 +1,4 @@ -# serial 5 +# serial 6 # From Paul Eggert. @@ -14,21 +14,7 @@ AC_DEFUN(AC_MBSTATE_T_OBJECT, [ AC_CHECK_HEADERS(stdlib.h) - AC_CACHE_CHECK([for mbstate_t], ac_cv_type_mbstate_t, - [AC_TRY_COMPILE([ -#if HAVE_STDLIB_H -# include <stdlib.h> -#endif -#include <wchar.h>], - [mbstate_t *x; return sizeof x;], - ac_cv_type_mbstate_t=yes, - ac_cv_type_mbstate_t=no)]) - if test $ac_cv_type_mbstate_t != yes; then - AC_DEFINE(mbstate_t, int, - [Define to int if <wchar.h> does not define.]) - fi - - AC_CACHE_CHECK([for mbstate_t object type], ac_cv_type_mbstate_t_object, + AC_CACHE_CHECK([for mbstate_t object], ac_cv_type_mbstate_t_object, [AC_TRY_COMPILE([ #if HAVE_STDLIB_H # include <stdlib.h> @@ -40,4 +26,18 @@ AC_DEFUN(AC_MBSTATE_T_OBJECT, if test $ac_cv_type_mbstate_t_object = yes; then AC_DEFINE(HAVE_MBSTATE_T_OBJECT, 1, [Define if mbstate_t is an object type.]) + else + AC_CACHE_CHECK([for mbstate_t], ac_cv_type_mbstate_t, + [AC_TRY_COMPILE([ +#if HAVE_STDLIB_H +# include <stdlib.h> +#endif +#include <wchar.h>], + [mbstate_t *x; return sizeof x;], + ac_cv_type_mbstate_t=yes, + ac_cv_type_mbstate_t=no)]) + if test $ac_cv_type_mbstate_t != yes; then + AC_DEFINE(mbstate_t, int, + [Define to int if <wchar.h> does not define.]) + fi fi]) |