"Fossies" - the Fresh Open Source Software Archive

Member "amavisd-milter-1.7.2/aclocal/eoverflow.m4" (6 Jan 2019, 2220 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://savannah.gnu.org/cgi-bin/viewcvs/gnulib/gnulib/m4/eoverflow.m4
    2 
    3 # eoverflow.m4 serial 2
    4 dnl Copyright (C) 2004, 2006 Free Software Foundation, Inc.
    5 dnl This file is free software; the Free Software Foundation
    6 dnl gives unlimited permission to copy and/or distribute it,
    7 dnl with or without modifications, as long as this notice is preserved.
    8 
    9 dnl From Bruno Haible.
   10 
   11 # The EOVERFLOW errno value ought to be defined in <errno.h>, according to
   12 # POSIX.  But some systems (like AIX 3) don't define it, and some systems
   13 # (like OSF/1) define it when _XOPEN_SOURCE_EXTENDED is defined.
   14 
   15 # Define EOVERFLOW as a C macro and as a substituted macro in such a way that
   16 # 1. on all systems, after inclusion of <errno.h>, EOVERFLOW is usable,
   17 # 2. on systems where EOVERFLOW is defined elsewhere, we use the same numeric
   18 #    value.
   19 
   20 AC_DEFUN([gl_EOVERFLOW],
   21 [
   22   AC_REQUIRE([AC_PROG_CC])dnl
   23 
   24   AC_CACHE_CHECK([for EOVERFLOW], ac_cv_decl_EOVERFLOW, [
   25     AC_EGREP_CPP(yes,[
   26 #include <errno.h>
   27 #ifdef EOVERFLOW
   28 yes
   29 #endif
   30       ], have_eoverflow=1)
   31     if test -n "$have_eoverflow"; then
   32       dnl EOVERFLOW exists in <errno.h>. Don't need to define EOVERFLOW ourselves.
   33       ac_cv_decl_EOVERFLOW=yes
   34     else
   35       AC_EGREP_CPP(yes,[
   36 #define _XOPEN_SOURCE_EXTENDED 1
   37 #include <errno.h>
   38 #ifdef EOVERFLOW
   39 yes
   40 #endif
   41         ], have_eoverflow=1)
   42       if test -n "$have_eoverflow"; then
   43         dnl EOVERFLOW exists but is hidden.
   44         dnl Define it to the same value.
   45         AC_COMPUTE_INT([EOVERFLOW], ac_cv_decl_EOVERFLOW, [
   46 #define _XOPEN_SOURCE_EXTENDED 1
   47 #include <errno.h>
   48 /* The following two lines are a workaround against an autoconf-2.52 bug.  */
   49 #include <stdio.h>
   50 #include <stdlib.h>
   51 ])
   52       else
   53         dnl EOVERFLOW isn't defined by the system. Define EOVERFLOW ourselves, but
   54         dnl don't define it as EINVAL, because snprintf() callers want to
   55         dnl distinguish EINVAL and EOVERFLOW.
   56         ac_cv_decl_EOVERFLOW=E2BIG
   57       fi
   58     fi
   59   ])
   60   if test "$ac_cv_decl_EOVERFLOW" != yes; then
   61     AC_DEFINE_UNQUOTED([EOVERFLOW], [$ac_cv_decl_EOVERFLOW],
   62                        [Define as good substitute value for EOVERFLOW.])
   63     EOVERFLOW="$ac_cv_decl_EOVERFLOW"
   64     AC_SUBST(EOVERFLOW)
   65   fi
   66 ])