define Rand() in isaac4 config
Rand() was typically defined to random() or to rand(). gcc seems to provide a random() to link to on linux when sys/share/random.c is linked in, but other platforms such as Windows got an undefined refence to random() when RANDOM wasn't defined. The only direct use seems to be in get_rnd_txt() these days, in rumors.c Under the USE_ISAAC64 config, neither srandom() nor srand() are being invoked to seed those routines, and it really should be using isaac64 when USE_ISAAC64 is defined anyway.
This commit is contained in:
@@ -7,9 +7,6 @@
|
||||
|
||||
/* #define SHELL */ /* nt use of pcsys routines caused a hang */
|
||||
|
||||
/* #define RANDOM */ /* have Berkeley random(3) */
|
||||
#define USE_ISAAC64
|
||||
|
||||
#define TEXTCOLOR /* Color text */
|
||||
|
||||
#define EXEPATH /* Allow .exe location to be used as HACKDIR */
|
||||
@@ -37,8 +34,9 @@
|
||||
|
||||
/*#define CHANGE_COLOR*/ /* allow palette changes */
|
||||
#define SELECTSAVED /* Provide menu of saved games to choose from at start */
|
||||
|
||||
|
||||
#define SYS_RANDOM_SEED /* Use random seed derived from CNG */
|
||||
|
||||
/*
|
||||
* -----------------------------------------------------------------
|
||||
* The remaining code shouldn't need modification.
|
||||
@@ -182,12 +180,18 @@ extern void FDECL(interject, (int));
|
||||
#include <time.h>
|
||||
|
||||
#define USE_STDARG
|
||||
#ifdef RANDOM
|
||||
|
||||
/* Use the high quality random number routines. */
|
||||
#ifdef USE_ISAAC64
|
||||
#define Rand() rn2(RAND_MAX)
|
||||
#else
|
||||
#define RANDOM
|
||||
#ifdef RANDOM
|
||||
#define Rand() random()
|
||||
#else
|
||||
#define Rand() rand()
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <sys/stat.h>
|
||||
#define FCMASK (_S_IREAD | _S_IWRITE) /* file creation mask */
|
||||
|
||||
Reference in New Issue
Block a user