diff options
author | Hans-Christoph Steiner <eighthave@users.sourceforge.net> | 2012-02-20 18:26:58 +0000 |
---|---|---|
committer | Hans-Christoph Steiner <eighthave@users.sourceforge.net> | 2012-02-20 18:26:58 +0000 |
commit | 89bc16599528f4978d3c7767be0561bb6c66cd86 (patch) | |
tree | 1da05ba8241fa3d40b5d1c1a838973bc720c1793 /externals/vanilla/random.c | |
parent | d967b146a8d0b6ec3c69ebc67ff8c66eaeb13a1c (diff) |
sync with x_misc.c from pure-data.git 0.42-1
svn path=/trunk/; revision=16005
Diffstat (limited to 'externals/vanilla/random.c')
-rw-r--r-- | externals/vanilla/random.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/externals/vanilla/random.c b/externals/vanilla/random.c index 8e988211..cf93c0fc 100644 --- a/externals/vanilla/random.c +++ b/externals/vanilla/random.c @@ -9,16 +9,26 @@ #include <math.h> #include <stdio.h> #include <string.h> -#ifdef UNISTD +#ifdef _WIN32 +#include <wtypes.h> +#include <time.h> +#else #include <sys/types.h> #include <sys/time.h> #include <sys/times.h> #include <sys/param.h> #include <unistd.h> +#endif /* _WIN32 */ + +#if defined (__APPLE__) || defined (__FreeBSD__) +#define CLOCKHZ CLK_TCK #endif -#ifdef _WIN32 -#include <wtypes.h> +#if defined (__linux__) || defined (__CYGWIN__) || defined (ANDROID) +#define CLOCKHZ sysconf(_SC_CLK_TCK) +#endif +#if defined (__FreeBSD_kernel__) || defined(__GNU__) #include <time.h> +#define CLOCKHZ CLOCKS_PER_SEC #endif static t_class *random_class; |