about summary refs log tree commit diff
path: root/src/rt/rust_uv.cpp
diff options
context:
space:
mode:
authorBrian Anderson <banderson@mozilla.com>2011-08-04 13:44:37 -0700
committerBrian Anderson <banderson@mozilla.com>2011-08-05 11:57:06 -0700
commite653520a6fcae74bfed108be9d88728685eab382 (patch)
treef54a04b444b39a043853b3ecdc5eed1118befc18 /src/rt/rust_uv.cpp
parent4178e52c8f521deb56037147f134a7a640fbe0cc (diff)
downloadrust-e653520a6fcae74bfed108be9d88728685eab382.tar.gz
rust-e653520a6fcae74bfed108be9d88728685eab382.zip
Fix uv_buf_t declaration on win32
The fields of this structure are mysteriously defined in the opposite order
on windows as on unix
Diffstat (limited to 'src/rt/rust_uv.cpp')
-rw-r--r--src/rt/rust_uv.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/rt/rust_uv.cpp b/src/rt/rust_uv.cpp
index d0d98aa5090..2d4d88b96cd 100644
--- a/src/rt/rust_uv.cpp
+++ b/src/rt/rust_uv.cpp
@@ -276,7 +276,15 @@ static void write_complete(request *req, int status) {
 extern "C" CDECL void aio_writedata(rust_task *task, socket_data *data,
                                     char *buf, size_t size, rust_chan *chan) {
   LOG_UPCALL_ENTRY(task);
+
+  // uv_buf_t is defined backwards on win32...
+  // maybe an indication we shouldn't be building directly?
+#if defined(__WIN32__)
+  uv_buf_t buffer = { size, buf };
+#else
   uv_buf_t buffer = { buf, size };
+#endif
+
   request *req = new (data->task, "write request")
     request(data, chan, write_complete);
   if (!req) {