X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=utils%2Fyarandom.h;h=14a287fa8c04ef432086bc3768ac8d2dde6ad0f7;hb=4cecfc89e5e889c7232693897c06168fb378bd5c;hp=abea226dc4c3fb0c5d0d7ddb0ee8b337467bd509;hpb=f54438ea00f152166e68073e98000fd3a00f65cd;p=xscreensaver diff --git a/utils/yarandom.h b/utils/yarandom.h index abea226d..14a287fa 100644 --- a/utils/yarandom.h +++ b/utils/yarandom.h @@ -1,4 +1,4 @@ -/* xscreensaver, Copyright (c) 1997, 1998 by Jamie Zawinski +/* xscreensaver, Copyright (c) 1997, 1998, 2003 by Jamie Zawinski * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -25,13 +25,23 @@ # include "vms-gtod.h" #endif -#define random() ya_random() -#define srandom(i) ya_rand_init(0) -#define RAND_MAX 0x7FFFFFFF - extern unsigned int ya_random (void); extern void ya_rand_init (unsigned int); +#define random() ya_random() +#define RAND_MAX 0xFFFFFFFF + +/*#define srandom(i) ya_rand_init(0)*/ + +/* Define these away to keep people from using the wrong APIs in xscreensaver. + */ +#define rand __ERROR_use_random_not_rand_in_xscreensaver__ +#define drand48 __ERROR_use_frand_not_drand48_in_xscreensaver__ +#define srandom __ERROR_do_not_call_srandom_in_xscreensaver__ +#define srand __ERROR_do_not_call_srand_in_xscreensaver__ +#define srand48 __ERROR_do_not_call_srand48_in_xscreensaver__ +#define ya_rand_init __ERROR_do_not_call_ya_rand_init_in_xscreensaver__ + #if defined (__GNUC__) && (__GNUC__ >= 2) /* Implement frand using GCC's statement-expression extension. */