Kaydet (Commit) 963659af authored tarafından Jack Jansen's avatar Jack Jansen

Got this to work in MacPython. The code is #ifdef macintosh style (to match the…

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.
üst 6f1da007
...@@ -31,8 +31,12 @@ typedef __int64 hs_time; ...@@ -31,8 +31,12 @@ typedef __int64 hs_time;
#ifndef HAVE_GETTIMEOFDAY #ifndef HAVE_GETTIMEOFDAY
#error "This module requires gettimeofday() on non-Windows platforms!" #error "This module requires gettimeofday() on non-Windows platforms!"
#endif #endif
#ifdef macintosh
#include <sys/time.h>
#else
#include <sys/resource.h> #include <sys/resource.h>
#include <sys/times.h> #include <sys/times.h>
#endif
typedef struct timeval hs_time; typedef struct timeval hs_time;
#endif #endif
...@@ -48,6 +52,10 @@ typedef struct timeval hs_time; ...@@ -48,6 +52,10 @@ typedef struct timeval hs_time;
#define BUFFERSIZE 10240 #define BUFFERSIZE 10240
#ifdef macintosh
#define PATH_MAX 254
#endif
#ifndef PATH_MAX #ifndef PATH_MAX
# ifdef MAX_PATH # ifdef MAX_PATH
# define PATH_MAX MAX_PATH # define PATH_MAX MAX_PATH
...@@ -304,7 +312,7 @@ unpack_string(LogReaderObject *self, PyObject **pvalue) ...@@ -304,7 +312,7 @@ unpack_string(LogReaderObject *self, PyObject **pvalue)
err = ERR_EOF; err = ERR_EOF;
} }
else { else {
*pvalue = PyString_FromStringAndSize(self->buffer + self->index, *pvalue = PyString_FromStringAndSize((char *)self->buffer + self->index,
len); len);
if (*pvalue == NULL) { if (*pvalue == NULL) {
self->index = oldindex; self->index = oldindex;
...@@ -889,7 +897,7 @@ calibrate(void) ...@@ -889,7 +897,7 @@ calibrate(void)
} }
#endif #endif
} }
#ifdef MS_WIN32 #if defined(MS_WIN32) || defined(macintosh)
rusage_diff = -1; rusage_diff = -1;
#else #else
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment