summaryrefslogtreecommitdiffstats
path: root/Modules/_hotshot.c
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>2001-10-23 22:26:16 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>2001-10-23 22:26:16 (GMT)
commit963659af2990d254b946a0630d7626abc3bbc500 (patch)
tree1511a478bc19e6570e9b5450d8d70f56717e46dc /Modules/_hotshot.c
parent6f1da007b9f9146a164554d389fdf0ad91fa46d7 (diff)
downloadcpython-963659af2990d254b946a0630d7626abc3bbc500.zip
cpython-963659af2990d254b946a0630d7626abc3bbc500.tar.gz
cpython-963659af2990d254b946a0630d7626abc3bbc500.tar.bz2
Got this to work in MacPython. The code is #ifdef macintosh style (to match the existing #ifdef MS_WINDOWS), but eventually ifdeffing on configure features is probably better.
Diffstat (limited to 'Modules/_hotshot.c')
-rw-r--r--Modules/_hotshot.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/Modules/_hotshot.c b/Modules/_hotshot.c
index 16af56f..2dbabcc 100644
--- a/Modules/_hotshot.c
+++ b/Modules/_hotshot.c
@@ -31,8 +31,12 @@ typedef __int64 hs_time;
#ifndef HAVE_GETTIMEOFDAY
#error "This module requires gettimeofday() on non-Windows platforms!"
#endif
+#ifdef macintosh
+#include <sys/time.h>
+#else
#include <sys/resource.h>
#include <sys/times.h>
+#endif
typedef struct timeval hs_time;
#endif
@@ -48,6 +52,10 @@ typedef struct timeval hs_time;
#define BUFFERSIZE 10240
+#ifdef macintosh
+#define PATH_MAX 254
+#endif
+
#ifndef PATH_MAX
# ifdef MAX_PATH
# define PATH_MAX MAX_PATH
@@ -304,7 +312,7 @@ unpack_string(LogReaderObject *self, PyObject **pvalue)
err = ERR_EOF;
}
else {
- *pvalue = PyString_FromStringAndSize(self->buffer + self->index,
+ *pvalue = PyString_FromStringAndSize((char *)self->buffer + self->index,
len);
if (*pvalue == NULL) {
self->index = oldindex;
@@ -889,7 +897,7 @@ calibrate(void)
}
#endif
}
-#ifdef MS_WIN32
+#if defined(MS_WIN32) || defined(macintosh)
rusage_diff = -1;
#else
{