summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiampaolo Rodola <g.rodola@gmail.com>2011-04-16 15:35:07 +0000
committerGiampaolo Rodola <g.rodola@gmail.com>2011-04-16 15:35:07 +0000
commitffd9a63021860a964ac13cfad8d278b0260075e8 (patch)
treef6c50a63db126550aabec7d96bce9e9f9aa3bce8
parent66148bc91604fbe95ff491f337dab62c5278e9d9 (diff)
downloadpysendfile-ffd9a63021860a964ac13cfad8d278b0260075e8.tar.gz
OSX: redefine sf_hdtr structure to make it work on Python 2.5 and lower
-rw-r--r--sendfilemodule.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/sendfilemodule.c b/sendfilemodule.c
index 39eaab5..810d2a2 100644
--- a/sendfilemodule.c
+++ b/sendfilemodule.c
@@ -51,6 +51,15 @@ int unsupported = 0;
#include <sys/socket.h>
#include <sys/uio.h>
+// needed on OSX - Python < 2.6
+#if defined(__APPLE__) && defined(_POSIX_C_SOURCE)
+struct sf_hdtr {
+ struct iovec *headers;
+ int hdr_cnt;
+ struct iovec *trailers;
+ int trl_cnt;
+};
+#endif
static PyObject *
method_sendfile(PyObject *self, PyObject *args, PyObject *kwdict)