[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: struct random_data in <stdlib.h>
From: |
Bruno Haible |
Subject: |
Re: struct random_data in <stdlib.h> |
Date: |
Tue, 8 Feb 2011 12:13:12 +0100 |
User-agent: |
KMail/1.9.9 |
Hi Paul,
I wrote:
> I would prefer this patch instead:
>
> --- lib/stdlib.in.h.orig Tue Feb 8 11:50:31 2011
> +++ lib/stdlib.in.h Tue Feb 8 11:50:19 2011
> @@ -50,17 +50,17 @@
> #endif
>
> /* OSF/1 5.1 declares 'struct random_data' in <random.h>, which is included
> - from <stdlib.h> if _REENTRANT is defined. Include it always. */
> -#if @HAVE_RANDOM_H@
> + from <stdlib.h> if _REENTRANT is defined. Include it whenever we need
> + 'struct random_data'. */
> +#if @GNULIB_RANDOM_R@ && @HAVE_RANDOM_H@
> # include <random.h>
> #endif
>
> -#if address@hidden@ || (@GNULIB_RANDOM_R@ && address@hidden@) \
> - || defined GNULIB_POSIXCHECK
> +#if @GNULIB_RANDOM_R@ && (address@hidden@ || address@hidden@)
> # include <stdint.h>
> #endif
>
> -#if address@hidden@
> +#if @GNULIB_RANDOM_R@ && address@hidden@
> /* Define 'struct random_data'.
> But allow multiple gnulib generated <stdlib.h> replacements to coexist.
> */
> # if !GNULIB_defined_struct_random_data
When you have done this, you can also move the test for random.h from
stdlib_h.m4 to random_r.m4:
AC_CHECK_HEADERS([random.h], [], [], [AC_INCLUDES_DEFAULT])
if test $ac_cv_header_random_h = yes; then
HAVE_RANDOM_H=1
else
HAVE_RANDOM_H=0
fi
AC_SUBST([HAVE_RANDOM_H])
is split into
HAVE_RANDOM_H=1; AC_SUBST([HAVE_RANDOM_H])
which goes into gl_STDLIB_H_DEFAULTS and
AC_CHECK_HEADERS([random.h], [], [], [AC_INCLUDES_DEFAULT])
if test $ac_cv_header_random_h = no; then
HAVE_RANDOM_H=0
fi
which goes into random_r.m4. One less test to be executed during
Emacs' 'configure'.
Bruno
--
In memoriam Ismail Semed <http://en.wikipedia.org/wiki/Ismail_Semed>