[git commit prelink] move prototype for __drand48_iterate and __libc_drand48_data to stdlib.h

Peter S. Mazinger ps.m at gmx.net
Wed Mar 30 11:53:36 UTC 2011


commit: http://git.uclibc.org/uClibc/commit/?id=7aea441c8a240bd5a0717ec09ae8efc4878cd377
branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/prelink

Move them to a common header guarded by _LIBC

Signed-off-by: Peter S. Mazinger <ps.m at gmx.net>
---
 include/stdlib.h           |    7 +++++++
 libc/stdlib/drand48-iter.c |    4 ----
 libc/stdlib/drand48.c      |    4 ----
 libc/stdlib/erand48.c      |    4 ----
 libc/stdlib/erand48_r.c    |    3 ---
 libc/stdlib/jrand48.c      |    4 ----
 libc/stdlib/jrand48_r.c    |    3 ---
 libc/stdlib/lrand48.c      |    4 ----
 libc/stdlib/mrand48.c      |    4 ----
 libc/stdlib/nrand48.c      |    4 ----
 libc/stdlib/nrand48_r.c    |    3 ---
 libc/stdlib/seed48.c       |    4 ----
 libc/stdlib/srand48.c      |    4 ----
 13 files changed, 7 insertions(+), 45 deletions(-)

diff --git a/include/stdlib.h b/include/stdlib.h
index 00bba5f..6afc321 100644
--- a/include/stdlib.h
+++ b/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
 
diff --git a/libc/stdlib/drand48-iter.c b/libc/stdlib/drand48-iter.c
index 221cbe0..e0c1ce4 100644
--- a/libc/stdlib/drand48-iter.c
+++ b/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;
diff --git a/libc/stdlib/drand48.c b/libc/stdlib/drand48.c
index 8c9017b..c53dcfb 100644
--- a/libc/stdlib/drand48.c
+++ b/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;
diff --git a/libc/stdlib/erand48.c b/libc/stdlib/erand48.c
index ee28d96..f3603cd 100644
--- a/libc/stdlib/erand48.c
+++ b/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;
diff --git a/libc/stdlib/erand48_r.c b/libc/stdlib/erand48_r.c
index e36e73e..bd40a34 100644
--- a/libc/stdlib/erand48_r.c
+++ b/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;
diff --git a/libc/stdlib/jrand48.c b/libc/stdlib/jrand48.c
index 163c540..8a06ced 100644
--- a/libc/stdlib/jrand48.c
+++ b/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;
diff --git a/libc/stdlib/jrand48_r.c b/libc/stdlib/jrand48_r.c
index 24f7075..5652d10 100644
--- a/libc/stdlib/jrand48_r.c
+++ b/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.  */
diff --git a/libc/stdlib/lrand48.c b/libc/stdlib/lrand48.c
index a0b15ca..915638b 100644
--- a/libc/stdlib/lrand48.c
+++ b/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;
diff --git a/libc/stdlib/mrand48.c b/libc/stdlib/mrand48.c
index b209acd..6f7cf73 100644
--- a/libc/stdlib/mrand48.c
+++ b/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;
diff --git a/libc/stdlib/nrand48.c b/libc/stdlib/nrand48.c
index 97c197c..5183484 100644
--- a/libc/stdlib/nrand48.c
+++ b/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;
diff --git a/libc/stdlib/nrand48_r.c b/libc/stdlib/nrand48_r.c
index 0710e90..b8ed0eb 100644
--- a/libc/stdlib/nrand48_r.c
+++ b/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.  */
diff --git a/libc/stdlib/seed48.c b/libc/stdlib/seed48.c
index 9ff8a48..a62dc2e 100644
--- a/libc/stdlib/seed48.c
+++ b/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])
 {
diff --git a/libc/stdlib/srand48.c b/libc/stdlib/srand48.c
index 817d068..f553743 100644
--- a/libc/stdlib/srand48.c
+++ b/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);
-- 
1.7.3.4



More information about the uClibc-cvs mailing list