4
0

mbstate_t.m4 854 B

1234567891011121314151617181920212223242526272829
  1. # serial 9
  2. # From Paul Eggert.
  3. # BeOS 5 has <wchar.h> but does not define mbstate_t,
  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],
  10. [
  11. AC_CHECK_HEADERS(stdlib.h)
  12. AC_CACHE_CHECK([for mbstate_t], ac_cv_type_mbstate_t,
  13. [AC_TRY_COMPILE([
  14. #if HAVE_STDLIB_H
  15. # include <stdlib.h>
  16. #endif
  17. #include <wchar.h>],
  18. [mbstate_t x; return sizeof x;],
  19. ac_cv_type_mbstate_t=yes,
  20. ac_cv_type_mbstate_t=no)])
  21. if test $ac_cv_type_mbstate_t = no; then
  22. AC_DEFINE(mbstate_t, int,
  23. [Define to a type if <wchar.h> does not define.])
  24. fi])