+2009-01-25 Bruno Haible <bruno@clisp.org>
+
+ Avoid redefining 'struct random_data' on OSF/1 5.1.
+ * lib/stdlib.in.h: Include <random.h> if it exists.
+ * m4/stdlib_h.m4 (gl_STDLIB_H): Test whether <random.h> exists. Set
+ HAVE_RANDOM_H. Include <random.h> when testing whether
+ 'struct random_data' exists.
+ * modules/stdlib (Makefile.am): Substitute HAVE_RANDOM_H.
+
2009-01-25 Bruno Haible <bruno@clisp.org>
Don't install charset.alias on MacOS X >= 10.3.
/* A GNU-like <stdlib.h>.
- 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
# include <sys/loadavg.h>
#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@
+# include <random.h>
+#endif
+
#if @GNULIB_RANDOM_R@ || !@HAVE_STRUCT_RANDOM_DATA@
# include <stdint.h>
#endif
-# 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.
[
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 <stdlib.h>]])
+ [[#include <stdlib.h>
+ #if HAVE_RANDOM_H
+ # include <random.h>
+ #endif
+ ]])
])
AC_DEFUN([gl_STDLIB_MODULE_INDICATOR],
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' \