/[autoconf]/autoconf/lib/autoconf/functions.m4
ViewVC logotype

Diff of /autoconf/lib/autoconf/functions.m4

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.66 by eggert, Wed Jun 12 07:20:14 2002 UTC revision 1.67 by akim, Wed Jul 17 08:09:43 2002 UTC
# Line 714  fi Line 714  fi
714  ])  ])
715    
716    
717  # AC_FUNC_MALLOC  # _AC_FUNC_MALLOC_IF(IF-WORKS, IF-NOT)
718  # --------------  # ------------------------------------
719  # Is `malloc (0)' properly handled?  # If `malloc (0)' properly handled, run IF-WORKS, otherwise, IF-NOT.
720  AC_DEFUN([AC_FUNC_MALLOC],  AC_DEFUN([_AC_FUNC_MALLOC_IF],
721  [AC_REQUIRE([AC_HEADER_STDC])dnl  [AC_REQUIRE([AC_HEADER_STDC])dnl
722  AC_CHECK_HEADERS(stdlib.h)  AC_CHECK_HEADERS(stdlib.h)
723  AC_CACHE_CHECK([for working malloc], ac_cv_func_malloc_works,  AC_CACHE_CHECK([for working malloc], ac_cv_func_malloc_works,
# Line 733  char *malloc (); Line 733  char *malloc ();
733                 [ac_cv_func_malloc_works=yes],                 [ac_cv_func_malloc_works=yes],
734                 [ac_cv_func_malloc_works=no],                 [ac_cv_func_malloc_works=no],
735                 [ac_cv_func_malloc_works=no])])                 [ac_cv_func_malloc_works=no])])
736  if test $ac_cv_func_malloc_works = yes; then  AS_IF([test $ac_cv_func_malloc_works = yes], [$1], [$2])
737    AC_DEFINE(HAVE_MALLOC, 1,  ])# AC_FUNC_MALLOC
738              [Define to 1 if your system has a working `malloc' function.])  
739  fi  
740    # AC_FUNC_MALLOC
741    # --------------
742    # Report whether `malloc (0)' properly handled, and replace malloc if
743    # needed.
744    AC_DEFUN([AC_FUNC_MALLOC],
745    [_AC_FUNC_MALLOC_IF(
746      [AC_DEFINE([HAVE_MALLOC], 1,
747                 [Define to 1 if your system has a working `malloc' function,
748                  and to 0 otherwise.])],
749      [AC_DEFINE([HAVE_MALLOC], 0)
750       AC_LIBOBJ(malloc)
751       AC_DEFINE([malloc], [rpl_malloc],
752          [Define to rpl_malloc if the replacement function should be used.])])
753  ])# AC_FUNC_MALLOC  ])# AC_FUNC_MALLOC
754    
755    
# Line 1115  fi Line 1128  fi
1128  AU_ALIAS([AM_FUNC_OBSTACK], [AC_FUNC_OBSTACK])  AU_ALIAS([AM_FUNC_OBSTACK], [AC_FUNC_OBSTACK])
1129    
1130    
1131    
1132    # _AC_FUNC_REALLOC_IF(IF-WORKS, IF-NOT)
1133    # -------------------------------------
1134    # If `realloc (0, 0)' properly handled, run IF-WORKS, otherwise, IF-NOT.
1135    AC_DEFUN([_AC_FUNC_REALLOC_IF],
1136    [AC_REQUIRE([AC_HEADER_STDC])dnl
1137    AC_CHECK_HEADERS(stdlib.h)
1138    AC_CACHE_CHECK([for working realloc], ac_cv_func_realloc_works,
1139    [AC_RUN_IFELSE(
1140    [AC_LANG_PROGRAM(
1141    [[#if STDC_HEADERS || HAVE_STDLIB_H
1142    # include <stdlib.h>
1143    #else
1144    char *realloc ();
1145    #endif
1146    ]],
1147                     [exit (realloc (0, 0) ? 0 : 1);])],
1148                   [ac_cv_func_realloc_works=yes],
1149                   [ac_cv_func_realloc_works=no],
1150                   [ac_cv_func_realloc_works=no])])
1151    AS_IF([test $ac_cv_func_realloc_works = yes], [$1], [$2])
1152    ])# AC_FUNC_REALLOC
1153    
1154    
1155    # AC_FUNC_REALLOC
1156    # ---------------
1157    # Report whether `realloc (0, 0)' properly handled, and replace realloc if
1158    # needed.
1159    AC_DEFUN([AC_FUNC_REALLOC],
1160    [_AC_FUNC_REALLOC_IF(
1161      [AC_DEFINE([HAVE_REALLOC], 1,
1162                 [Define to 1 if your system has a working `realloc' function,
1163                  and to 0 otherwise.])],
1164      [AC_DEFINE([HAVE_REALLOC], 0)
1165       AC_LIBOBJ([realloc])
1166       AC_DEFINE([realloc], [rpl_realloc],
1167          [Define to rpl_realloc if the replacement function should be used.])])
1168    ])# AC_FUNC_REALLOC
1169    
1170    
1171  # AC_FUNC_SELECT_ARGTYPES  # AC_FUNC_SELECT_ARGTYPES
1172  # -----------------------  # -----------------------
1173  # Determine the correct type to be passed to each of the `select'  # Determine the correct type to be passed to each of the `select'

Legend:
Removed from v.1.66  
changed lines
  Added in v.1.67

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26