Mercurial > hg > octave-lojdl > gnulib-hg
changeset 2709:326e945c4f6a
(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.
author | Jim Meyering <jim@meyering.net> |
---|---|
date | Thu, 06 Jul 2000 04:46:48 +0000 |
parents | 66a87d9c9349 |
children | 5958855b04db |
files | m4/mbstate_t.m4 |
diffstat | 1 files changed, 16 insertions(+), 16 deletions(-) [+] |
line wrap: on
line diff
--- 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_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 @@ 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])