4
0

mbstate_t.m4 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. # serial 4
  2. # From Paul Eggert.
  3. # Some versions of BeOS define mbstate_t to be an incomplete type,
  4. # so you can't declare an object of that type.
  5. # Check for this incompatibility with Standard C.
  6. # Include stdlib.h first, because otherwise this test would fail on Linux
  7. # (at least glibc-2.1.3) because the `_XOPEN_SOURCE 500' definition elicits
  8. # a syntax error in wchar.h due to the use of undefined __int32_t.
  9. AC_DEFUN(AC_MBSTATE_T_OBJECT,
  10. [
  11. # Check for the mbstate_t type.
  12. ac_mbs_tmp=$ac_includes_default
  13. ac_includes_default="
  14. $ac_includes_default
  15. #if HAVE_WCHAR_H
  16. # include <wchar.h>
  17. #endif
  18. "
  19. AC_CHECK_TYPE(mbstate_t, int)
  20. # Restore the default value.
  21. ac_includes_default=$ac_mbs_tmp
  22. AC_CACHE_CHECK([for mbstate_t object type], ac_cv_type_mbstate_t_object,
  23. [AC_TRY_COMPILE([
  24. #if HAVE_STDLIB_H
  25. # include <stdlib.h>
  26. #endif
  27. #include <wchar.h>],
  28. [mbstate_t x; return sizeof x;],
  29. ac_cv_type_mbstate_t_object=yes,
  30. ac_cv_type_mbstate_t_object=no)])
  31. if test $ac_cv_type_mbstate_t_object = yes; then
  32. AC_DEFINE(HAVE_MBSTATE_T_OBJECT, 1,
  33. [Define if mbstate_t is an object type.])
  34. fi])