5 # Some versions of BeOS define mbstate_t to be an incomplete type,
6 # so you can't declare an object of that type.
7 # Check for this incompatibility with Standard C.
9 # Include stdlib.h first, because otherwise this test would fail on Linux
10 # (at least glibc-2.1.3) because the `_XOPEN_SOURCE 500' definition elicits
11 # a syntax error in wchar.h due to the use of undefined __int32_t.
13 AC_DEFUN(AC_MBSTATE_T_OBJECT,
15 AC_CHECK_HEADERS(stdlib.h)
17 AC_CACHE_CHECK([for mbstate_t object], ac_cv_type_mbstate_t_object,
23 [mbstate_t x; return sizeof x;],
24 ac_cv_type_mbstate_t_object=yes,
25 ac_cv_type_mbstate_t_object=no)])
26 if test $ac_cv_type_mbstate_t_object = yes; then
27 AC_DEFINE(HAVE_MBSTATE_T_OBJECT, 1,
28 [Define if mbstate_t is an object type.])
30 AC_CACHE_CHECK([for mbstate_t], ac_cv_type_mbstate_t,
36 [mbstate_t *x; return sizeof x;],
37 ac_cv_type_mbstate_t=yes,
38 ac_cv_type_mbstate_t=no)])
39 if test $ac_cv_type_mbstate_t != yes; then
40 AC_DEFINE(mbstate_t, int,
41 [Define to int if <wchar.h> does not define.])