[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
struct random_data on OSF/1
From: |
Bruno Haible |
Subject: |
struct random_data on OSF/1 |
Date: |
Sun, 25 Jan 2009 21:47:18 +0100 |
User-agent: |
KMail/1.9.9 |
On OSF/1 5.1, the gettext build fails like this:
cc: Error: ../gnulib-lib/stdlib.h, line 50: In this declaration, the struct
"random_data" is redefined. (redefstruct)
struct random_data
^
*** Exit 1
The reason is that this platform has 'struct random_data' declared in
<random.h>, not in <stdlib.h>. So configure found that
HAVE_STRUCT_RANDOM_DATA=0.
But when _REENTRANT is defined - and this happens in gettext during "make"
but not during configure, then <stdlib.h> includes <random.h> and makes
'struct random_data' visible: it contains
#if defined(_REENTRANT) || defined(_THREAD_SAFE)
#include <random.h>
#endif /* _REENTRANT || _THREAD_SAFE */
This should fix it.
2009-01-25 Bruno Haible <address@hidden>
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.
--- lib/stdlib.in.h.orig 2009-01-25 21:39:48.000000000 +0100
+++ lib/stdlib.in.h 2009-01-25 21:27:58.000000000 +0100
@@ -1,6 +1,6 @@
/* 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
@@ -41,6 +41,12 @@
# 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@ || address@hidden@
# include <stdint.h>
#endif
--- m4/stdlib_h.m4.orig 2009-01-25 21:39:48.000000000 +0100
+++ m4/stdlib_h.m4 2009-01-25 21:30:33.000000000 +0100
@@ -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_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],
--- modules/stdlib.orig 2009-01-25 21:39:48.000000000 +0100
+++ modules/stdlib 2009-01-25 21:31:42.000000000 +0100
@@ -24,6 +24,7 @@
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' \
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- struct random_data on OSF/1,
Bruno Haible <=