Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/utils_tests.h

    r8386dbe r0512fca  
    5656#endif
    5757
    58 // are we on windows ? or are we using -std=c99 ?
    59 #if defined(HAVE_WIN_HACKS) || defined(__STRICT_ANSI__)
    60 // http://en.wikipedia.org/wiki/Linear_congruential_generator
    61 // no srandom/random on win32
     58#if defined(HAVE_WIN_HACKS)
    6259
    63 uint_t srandom_seed = 1029;
     60// use srand/rand on windows
     61#define srandom srand
     62#define random rand
    6463
    65 void srandom(uint_t new_seed) {
    66     srandom_seed = new_seed;
    67 }
     64#elif defined(__STRICT_ANSI__)
    6865
    69 uint_t random(void) {
    70     srandom_seed = 1664525 * srandom_seed + 1013904223;
    71     return srandom_seed;
    72 }
     66// workaround to build with -std=c99 (for instance with older cygwin),
     67// assuming libbc is recent enough to supports these functions.
     68extern void srandom(unsigned);
     69extern int random(void);
     70extern char mkstemp(const char *pat);
     71
    7372#endif
    7473
Note: See TracChangeset for help on using the changeset viewer.