aboutsummaryrefslogtreecommitdiff
path: root/externals/vanilla/loadbang.c
diff options
context:
space:
mode:
authorHans-Christoph Steiner <eighthave@users.sourceforge.net>2012-02-20 18:26:58 +0000
committerHans-Christoph Steiner <eighthave@users.sourceforge.net>2012-02-20 18:26:58 +0000
commit89bc16599528f4978d3c7767be0561bb6c66cd86 (patch)
tree1da05ba8241fa3d40b5d1c1a838973bc720c1793 /externals/vanilla/loadbang.c
parentd967b146a8d0b6ec3c69ebc67ff8c66eaeb13a1c (diff)
sync with x_misc.c from pure-data.git 0.42-1
svn path=/trunk/; revision=16005
Diffstat (limited to 'externals/vanilla/loadbang.c')
-rw-r--r--externals/vanilla/loadbang.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/externals/vanilla/loadbang.c b/externals/vanilla/loadbang.c
index 718edb01..55bf458c 100644
--- a/externals/vanilla/loadbang.c
+++ b/externals/vanilla/loadbang.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 *loadbang_class;