enumerator::handle: replace incorrect delete by free
[barvinok.git] / m4 / wctype.m4
blobc24e75f26946e3fc2ecc12f40e6884677f555476
1 dnl A placeholder for ISO C99 <wctype.h>, for platforms that lack it.
3 dnl Copyright (C) 2006 Free Software Foundation, Inc.
4 dnl This file is free software; the Free Software Foundation
5 dnl gives unlimited permission to copy and/or distribute it,
6 dnl with or without modifications, as long as this notice is preserved.
8 dnl Written by Paul Eggert.
10 AC_DEFUN([gl_WCTYPE_H],
12   AC_CHECK_FUNCS_ONCE([iswcntrl])
13   AC_CHECK_HEADERS_ONCE([wctype.h])
14   AC_REQUIRE([AC_C_INLINE])
16   AC_REQUIRE([gt_TYPE_WINT_T])
17   AC_SUBST([HAVE_WINT_T])
19   if test $ac_cv_header_wctype_h = yes; then
20     gl_ABSOLUTE_HEADER([wctype.h])
21     ABSOLUTE_WCTYPE_H=\"$gl_cv_absolute_wctype_h\"
22     HAVE_WCTYPE_H=1
23   else
24     ABSOLUTE_WCTYPE_H=\"no/such/file/wctype.h\"
25     HAVE_WCTYPE_H=0
26   fi
27   AC_SUBST([ABSOLUTE_WCTYPE_H])
28   AC_SUBST([HAVE_WCTYPE_H])
30   WCTYPE_H=wctype.h
31   HAVE_WCTYPE_CTMP_BUG=0
32   if test $ac_cv_header_wctype_h = yes; then
33     dnl IRIX 5.3 has a bug: its isw* macros reference an undefined variable
34     dnl _ctmp_. Test against this bug.
35     AC_CACHE_CHECK([whether wctype macros need _ctmp_ declared],
36       [gl_cv_wctype_ctmp_bug],
37       [gl_cv_wctype_ctmp_bug=no
38        AC_COMPILE_IFELSE(
39          [AC_LANG_PROGRAM(
40             [[#include <wctype.h>
41             ]],
42             [[return iswprint (0);]])],
43          [gl_cv_wctype_ctmp_bug='no, but bare wctype.h does not work'],
44          [AC_COMPILE_IFELSE(
45             [AC_LANG_PROGRAM(
46                [[#include <wctype.h>
47                  static wint_t _ctmp_;]],
48                [[return iswprint (0);]])],
49             [gl_cv_wctype_ctmp_bug=yes])])])
50     case $gl_cv_wctype_ctmp_bug,$ac_cv_func_iswcntrl in #(
51       yes,*)
52         HAVE_WCTYPE_CTMP_BUG=1;; #(
53       no,yes)
54         WCTYPE_H=;;
55     esac
56   fi
57   AC_SUBST([WCTYPE_H])
58   AC_SUBST([HAVE_WCTYPE_CTMP_BUG])