annotate m4/malloc.m4 @ 423:079d43b6967b 3.0-beta2 3.0-beta2

Added missing file
author lost@l-w.ca
date Sun, 19 Sep 2010 01:44:47 -0600
parents 3c2e1f24cc7d
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
421
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1 # malloc.m4 serial 9
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
2 dnl Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
3 dnl This file is free software; the Free Software Foundation
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
4 dnl gives unlimited permission to copy and/or distribute it,
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
5 dnl with or without modifications, as long as this notice is preserved.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
6
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
7 # gl_FUNC_MALLOC_POSIX
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
8 # --------------------
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
9 # Test whether 'malloc' is POSIX compliant (sets errno to ENOMEM when it
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
10 # fails), and replace malloc if it is not.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
11 AC_DEFUN([gl_FUNC_MALLOC_POSIX],
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
12 [
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
13 AC_REQUIRE([gl_CHECK_MALLOC_POSIX])
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
14 if test $gl_cv_func_malloc_posix = yes; then
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
15 HAVE_MALLOC_POSIX=1
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
16 AC_DEFINE([HAVE_MALLOC_POSIX], [1],
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
17 [Define if the 'malloc' function is POSIX compliant.])
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
18 else
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
19 AC_LIBOBJ([malloc])
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
20 HAVE_MALLOC_POSIX=0
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
21 fi
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
22 AC_SUBST([HAVE_MALLOC_POSIX])
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
23 ])
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
24
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
25 # Test whether malloc, realloc, calloc are POSIX compliant,
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
26 # Set gl_cv_func_malloc_posix to yes or no accordingly.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
27 AC_DEFUN([gl_CHECK_MALLOC_POSIX],
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
28 [
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
29 AC_CACHE_CHECK([whether malloc, realloc, calloc are POSIX compliant],
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
30 [gl_cv_func_malloc_posix],
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
31 [
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
32 dnl It is too dangerous to try to allocate a large amount of memory:
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
33 dnl some systems go to their knees when you do that. So assume that
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
34 dnl all Unix implementations of the function are POSIX compliant.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
35 AC_TRY_COMPILE([],
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
36 [#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
37 choke me
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
38 #endif
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
39 ], [gl_cv_func_malloc_posix=yes], [gl_cv_func_malloc_posix=no])
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
40 ])
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
41 ])