"Fossies" - the Fresh Open Source Software Archive

Member "amavisd-milter-1.7.2/aclocal/eilseq.m4" (6 Jan 2019, 1853 Bytes) of package /linux/privat/amavisd-milter-1.7.2.tar.gz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 # http://cvs.sourceforge.net/viewcvs.py/libiconv/m4/eilseq.m4
    2 
    3 #serial 1
    4 
    5 AC_PREREQ(2.50)
    6 
    7 # The EILSEQ errno value ought to be defined in <errno.h>, according to
    8 # ISO C 99 and POSIX.  But some systems (like SunOS 4) don't define it,
    9 # and some systems (like BSD/OS) define it in <wchar.h> not <errno.h>.
   10 
   11 # Define EILSEQ as a C macro and as a substituted macro in such a way that
   12 # 1. on all systems, after inclusion of <errno.h>, EILSEQ is usable,
   13 # 2. on systems where EILSEQ is defined elsewhere, we use the same numeric
   14 #    value.
   15 
   16 AC_DEFUN([AC_EILSEQ],
   17 [
   18   AC_REQUIRE([AC_PROG_CC])dnl
   19 
   20   dnl Check for any extra headers that could define EILSEQ.
   21   AC_CHECK_HEADERS(wchar.h)
   22 
   23   AC_CACHE_CHECK([for EILSEQ], ac_cv_decl_EILSEQ, [
   24     AC_EGREP_CPP(yes,[
   25 #include <errno.h>
   26 #ifdef EILSEQ
   27 yes
   28 #endif
   29       ], have_eilseq=1)
   30     if test -n "$have_eilseq"; then
   31       dnl EILSEQ exists in <errno.h>. Don't need to define EILSEQ ourselves.
   32       ac_cv_decl_EILSEQ=yes
   33     else
   34       AC_EGREP_CPP(yes,[
   35 #include <errno.h>
   36 #if HAVE_WCHAR_H
   37 #include <wchar.h>
   38 #endif
   39 #ifdef EILSEQ
   40 yes
   41 #endif
   42         ], have_eilseq=1)
   43       if test -n "$have_eilseq"; then
   44         dnl EILSEQ exists in some other system header.
   45         dnl Define it to the same value.
   46         _AC_COMPUTE_INT([EILSEQ], ac_cv_decl_EILSEQ, [
   47 #include <errno.h>
   48 #if HAVE_WCHAR_H
   49 #include <wchar.h>
   50 #endif
   51 /* The following two lines are a workaround against an autoconf-2.52 bug.  */
   52 #include <stdio.h>
   53 #include <stdlib.h>
   54 ])
   55       else
   56         dnl EILSEQ isn't defined by the system. Define EILSEQ ourselves.
   57         ac_cv_decl_EILSEQ=EINVAL
   58       fi
   59     fi
   60   ])
   61   if test "$ac_cv_decl_EILSEQ" != yes; then
   62     AC_DEFINE_UNQUOTED([EILSEQ], [$ac_cv_decl_EILSEQ],
   63                        [Define as good substitute value for EILSEQ.])
   64     EILSEQ="$ac_cv_decl_EILSEQ"
   65     AC_SUBST(EILSEQ)
   66   fi
   67 ])