summaryrefslogtreecommitdiffstats
path: root/libc/stdlib/random.c
diff options
context:
space:
mode:
author"Steven J. Hill" <sjhill@realitydiluted.com>2006-02-25 04:03:33 +0000
committer"Steven J. Hill" <sjhill@realitydiluted.com>2006-02-25 04:03:33 +0000
commitcb6a88484ce0b5ffba2fe98a40e2d51f4af92eb8 (patch)
tree520f8e8d113184cfa7954ebd274564b8c255fa9a /libc/stdlib/random.c
parente4461be66e2655058aef358b00050bc70ac72861 (diff)
downloaduClibc-alpine-cb6a88484ce0b5ffba2fe98a40e2d51f4af92eb8.tar.bz2
uClibc-alpine-cb6a88484ce0b5ffba2fe98a40e2d51f4af92eb8.tar.xz
Merge from trunk. Going pretty good so far. Kind of. Okay, not really.
Diffstat (limited to 'libc/stdlib/random.c')
-rw-r--r--libc/stdlib/random.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/libc/stdlib/random.c b/libc/stdlib/random.c
index eb146098a..9f1977ee3 100644
--- a/libc/stdlib/random.c
+++ b/libc/stdlib/random.c
@@ -22,17 +22,16 @@
* Rewritten to use reentrant functions by Ulrich Drepper, 1995.
*/
-#define random_r __random_r
-#define srandom_r __srandom_r
-#define setstate_r __setstate_r
-#define initstate_r __initstate_r
-
-#define _GNU_SOURCE
#include <features.h>
#include <limits.h>
#include <stddef.h>
#include <stdlib.h>
+libc_hidden_proto(random_r)
+libc_hidden_proto(srandom_r)
+libc_hidden_proto(setstate_r)
+libc_hidden_proto(initstate_r)
+
#ifdef __UCLIBC_HAS_THREADS__
# include <pthread.h>
/* POSIX.1c requires that there is mutual exclusion for the `rand' and
@@ -191,7 +190,7 @@ void srandom (unsigned int x)
srandom_r (x, &unsafe_state);
__pthread_mutex_unlock(&lock);
}
-weak_alias (srandom, srand)
+strong_alias(srandom,srand)
/* Initialize the state information in the given array of N bytes for
future random number generation. Based on the number of bytes we
@@ -246,7 +245,8 @@ char * setstate (char *arg_state)
rear pointers can't wrap on the same call by not testing the rear
pointer if the front one has wrapped. Returns a 31-bit random number. */
-long int attribute_hidden __random (void)
+libc_hidden_proto(random)
+long int random (void)
{
int32_t retval;
@@ -255,4 +255,4 @@ long int attribute_hidden __random (void)
__pthread_mutex_unlock(&lock);
return retval;
}
-strong_alias(__random,random)
+libc_hidden_def(random)