Changeset 0512fca


Ignore:
Timestamp:
Dec 17, 2018, 2:03:42 AM (5 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/timestretch, fix/ffmpeg5, master
Children:
05774ba3, 40bdc14
Parents:
c0a1906
Message:

[tests] use srand/rand on windows, declare mkstemp and srandom for c99

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/utils_tests.h

    rc0a1906 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.