Browse Source

move prototype for __drand48_iterate and __libc_drand48_data to stdlib.h

Move them to a common header guarded by _LIBC

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Peter S. Mazinger 13 years ago
parent
commit
7aea441c8a

+ 7 - 0
include/stdlib.h

@@ -908,6 +908,13 @@ libc_hidden_proto(arc4random_stir)
 extern void arc4random_addrandom(unsigned char *, int);
 #endif
 
+#ifdef _LIBC
+extern int __drand48_iterate (unsigned short int xsubi[3], struct drand48_data *buffer) attribute_hidden;
+
+/* Global state for non-reentrant functions.  */
+extern struct drand48_data __libc_drand48_data attribute_hidden;
+#endif
+
 #endif /* don't just need malloc and calloc */
 #undef __need_malloc_and_calloc
 

+ 0 - 4
libc/stdlib/drand48-iter.c

@@ -23,13 +23,9 @@
 #include <stdint.h>
 #include <sys/types.h>
 
-/* Global state for non-reentrant functions.  */
-struct drand48_data __libc_drand48_data attribute_hidden;
-
 #ifdef __UCLIBC_MJN3_ONLY__
 #warning turn int __drand48_iterate into void
 #endif /* __UCLIBC_MJN3_ONLY__ */
-int __drand48_iterate (unsigned short int xsubi[3], struct drand48_data *buffer) attribute_hidden;
 int __drand48_iterate (unsigned short int xsubi[3], struct drand48_data *buffer)
 {
   uint64_t X;

+ 0 - 4
libc/stdlib/drand48.c

@@ -19,10 +19,6 @@
 
 #include <stdlib.h>
 
-
-/* Global state for non-reentrant functions.  Defined in drand48-iter.c.  */
-extern struct drand48_data __libc_drand48_data attribute_hidden;
-
 double drand48 (void)
 {
   double result;

+ 0 - 4
libc/stdlib/erand48.c

@@ -19,10 +19,6 @@
 
 #include <stdlib.h>
 
-
-/* Global state for non-reentrant functions.  Defined in drand48-iter.c.  */
-extern struct drand48_data __libc_drand48_data attribute_hidden;
-
 double erand48 (unsigned short int xsubi[3])
 {
     double result;

+ 0 - 3
libc/stdlib/erand48_r.c

@@ -21,9 +21,6 @@
 #include <stdlib.h>
 #include <limits.h>
 
-extern int __drand48_iterate(unsigned short xsubi[3],
-	struct drand48_data *buffer) attribute_hidden;
-
 int erand48_r (unsigned short int xsubi[3], struct drand48_data *buffer, double *result)
 {
     union ieee754_double temp;

+ 0 - 4
libc/stdlib/jrand48.c

@@ -19,10 +19,6 @@
 
 #include <stdlib.h>
 
-
-/* Global state for non-reentrant functions.  Defined in drand48-iter.c.  */
-extern struct drand48_data __libc_drand48_data attribute_hidden;
-
 long int jrand48 (unsigned short int xsubi[3])
 {
     long int result;

+ 0 - 3
libc/stdlib/jrand48_r.c

@@ -19,9 +19,6 @@
 
 #include <stdlib.h>
 
-extern int __drand48_iterate(unsigned short xsubi[3],
-	struct drand48_data *buffer) attribute_hidden;
-
 int jrand48_r (unsigned short int xsubi[3], struct drand48_data *buffer, long int *result)
 {
     /* Compute next state.  */

+ 0 - 4
libc/stdlib/lrand48.c

@@ -19,10 +19,6 @@
 
 #include <stdlib.h>
 
-
-/* Global state for non-reentrant functions.  Defined in drand48-iter.c.  */
-extern struct drand48_data __libc_drand48_data attribute_hidden;
-
 long int lrand48 (void)
 {
     long int result;

+ 0 - 4
libc/stdlib/mrand48.c

@@ -19,10 +19,6 @@
 
 #include <stdlib.h>
 
-
-/* Global state for non-reentrant functions.  Defined in drand48-iter.c.  */
-extern struct drand48_data __libc_drand48_data attribute_hidden;
-
 long int mrand48 (void)
 {
     long int result;

+ 0 - 4
libc/stdlib/nrand48.c

@@ -19,10 +19,6 @@
 
 #include <stdlib.h>
 
-
-/* Global state for non-reentrant functions.  Defined in drand48-iter.c.  */
-extern struct drand48_data __libc_drand48_data attribute_hidden;
-
 long int nrand48 (unsigned short int xsubi[3])
 {
     long int result;

+ 0 - 3
libc/stdlib/nrand48_r.c

@@ -19,9 +19,6 @@
 
 #include <stdlib.h>
 
-extern int __drand48_iterate(unsigned short xsubi[3],
-	struct drand48_data *buffer) attribute_hidden;
-
 int nrand48_r (unsigned short int xsubi[3], struct drand48_data *buffer, long int *result)
 {
     /* Compute next state.  */

+ 0 - 4
libc/stdlib/seed48.c

@@ -19,10 +19,6 @@
 
 #include <stdlib.h>
 
-
-/* Global state for non-reentrant functions.  Defined in drand48-iter.c.  */
-extern struct drand48_data __libc_drand48_data attribute_hidden;
-
 unsigned short int *
 seed48 (unsigned short int seed16v[3])
 {

+ 0 - 4
libc/stdlib/srand48.c

@@ -19,10 +19,6 @@
 
 #include <stdlib.h>
 
-
-/* Global state for non-reentrant functions.  Defined in drand48-iter.c.  */
-extern struct drand48_data __libc_drand48_data attribute_hidden;
-
 void srand48 (long seedval)
 {
     srand48_r (seedval, &__libc_drand48_data);