From: Bruno Haible Date: Sun, 25 Jan 2009 20:47:34 +0000 (+0100) Subject: Avoid redefining 'struct random_data' on OSF/1 5.1. X-Git-Tag: v0.1~6400 X-Git-Url: http://erislabs.net/gitweb/?a=commitdiff_plain;h=15108d51e5d1b90e53bfac1f157617db1c3a3351;p=gnulib.git Avoid redefining 'struct random_data' on OSF/1 5.1. --- diff --git a/ChangeLog b/ChangeLog index 254e1dbc7..7aaf2a8db 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,14 @@ 2009-01-25 Bruno Haible + Avoid redefining 'struct random_data' on OSF/1 5.1. + * lib/stdlib.in.h: Include if it exists. + * m4/stdlib_h.m4 (gl_STDLIB_H): Test whether exists. Set + HAVE_RANDOM_H. Include when testing whether + 'struct random_data' exists. + * modules/stdlib (Makefile.am): Substitute HAVE_RANDOM_H. + +2009-01-25 Bruno Haible + Don't install charset.alias on MacOS X >= 10.3. * lib/localcharset.c (DARWIN7): New macro. (get_charset_aliases): Hardcode the result for Darwin7. diff --git a/lib/stdlib.in.h b/lib/stdlib.in.h index 3820b1097..f99767f60 100644 --- a/lib/stdlib.in.h +++ b/lib/stdlib.in.h @@ -1,6 +1,6 @@ /* A GNU-like . - Copyright (C) 1995, 2001-2004, 2006-2008 Free Software Foundation, Inc. + Copyright (C) 1995, 2001-2004, 2006-2009 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -41,6 +41,12 @@ # include #endif +/* OSF/1 5.1 declares 'struct random_data' in , which is included + from if _REENTRANT is defined. Include it always. */ +#if @HAVE_RANDOM_H@ +# include +#endif + #if @GNULIB_RANDOM_R@ || !@HAVE_STRUCT_RANDOM_DATA@ # include #endif diff --git a/m4/stdlib_h.m4 b/m4/stdlib_h.m4 index 582db13df..515befeb7 100644 --- a/m4/stdlib_h.m4 +++ b/m4/stdlib_h.m4 @@ -1,5 +1,5 @@ -# stdlib_h.m4 serial 13 -dnl Copyright (C) 2007, 2008 Free Software Foundation, Inc. +# stdlib_h.m4 serial 14 +dnl Copyright (C) 2007-2009 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -8,9 +8,20 @@ AC_DEFUN([gl_STDLIB_H], [ AC_REQUIRE([gl_STDLIB_H_DEFAULTS]) gl_CHECK_NEXT_HEADERS([stdlib.h]) + AC_CHECK_HEADERS([random.h]) + if test $ac_cv_header_random_h = yes; then + HAVE_RANDOM_H=1 + else + HAVE_RANDOM_H=0 + fi + AC_SUBST([HAVE_RANDOM_H]) AC_CHECK_TYPES([struct random_data], [], [HAVE_STRUCT_RANDOM_DATA=0], - [[#include ]]) + [[#include + #if HAVE_RANDOM_H + # include + #endif + ]]) ]) AC_DEFUN([gl_STDLIB_MODULE_INDICATOR], diff --git a/modules/stdlib b/modules/stdlib index edd9e4540..38cc2be63 100644 --- a/modules/stdlib +++ b/modules/stdlib @@ -24,6 +24,7 @@ stdlib.h: stdlib.in.h sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ -e 's|@''NEXT_STDLIB_H''@|$(NEXT_STDLIB_H)|g' \ + -e 's|@''HAVE_RANDOM_H''@|$(HAVE_RANDOM_H)|g' \ -e 's|@''GNULIB_MALLOC_POSIX''@|$(GNULIB_MALLOC_POSIX)|g' \ -e 's|@''GNULIB_REALLOC_POSIX''@|$(GNULIB_REALLOC_POSIX)|g' \ -e 's|@''GNULIB_CALLOC_POSIX''@|$(GNULIB_CALLOC_POSIX)|g' \