about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2013-09-18 02:25:57 -0700
committerbors <bors@rust-lang.org>2013-09-18 02:25:57 -0700
commitadb638f54d7d9a3bf2f66fa654a5dcd816a4b427 (patch)
tree14553ec3d627a53c46925f3bea91bd476e8dff77 /src
parent7dd9344b0359d1ee63bf6b3c01e6c0c209602e5d (diff)
parente6832e6b96bc2f3bc9fabceade437f46b0101a92 (diff)
auto merge of #9254 : vadimcn/rust/fix-mingw-v4, r=brson
Fix Rust build on mingw v4.0
See #9246 for details.
Diffstat (limited to 'src')
-rw-r--r--src/etc/mingw-fix-include/README.txt6
-rw-r--r--src/etc/mingw-fix-include/bits/c++config.h8
-rw-r--r--src/etc/mingw-fix-include/winbase.h8
-rw-r--r--src/etc/mingw-fix-include/winsock2.h12
-rw-r--r--src/test/run-pass/extern-pass-TwoU64s-ref.rs1
-rw-r--r--src/test/run-pass/extern-pass-TwoU64s.rs1
-rw-r--r--src/test/run-pass/extern-return-TwoU64s.rs2
-rw-r--r--src/test/run-pass/struct-return.rs2
8 files changed, 40 insertions, 0 deletions
diff --git a/src/etc/mingw-fix-include/README.txt b/src/etc/mingw-fix-include/README.txt
new file mode 100644
index 00000000000..876db17a248
--- /dev/null
+++ b/src/etc/mingw-fix-include/README.txt
@@ -0,0 +1,6 @@
+The purpose of these headers is to fix issues with mingw v4.0, as described in #9246.
+
+This works by adding this directory to GCC include search path before mingw system headers directories, 
+so we can intercept their inclusions and add missing definitions without having to modify files in mingw/include.
+
+Once mingw fixes all 3 issues mentioned in #9246, this directory and all references to it from rust/mk/* may be removed.
diff --git a/src/etc/mingw-fix-include/bits/c++config.h b/src/etc/mingw-fix-include/bits/c++config.h
new file mode 100644
index 00000000000..4520779e275
--- /dev/null
+++ b/src/etc/mingw-fix-include/bits/c++config.h
@@ -0,0 +1,8 @@
+#ifndef _FIX_CXXCONFIG_H
+#define _FIX_CXXCONFIG_H 1
+
+#define _GLIBCXX_HAVE_FENV_H 1
+
+#include_next <bits/c++config.h>
+
+#endif
diff --git a/src/etc/mingw-fix-include/winbase.h b/src/etc/mingw-fix-include/winbase.h
new file mode 100644
index 00000000000..3be26d1cb34
--- /dev/null
+++ b/src/etc/mingw-fix-include/winbase.h
@@ -0,0 +1,8 @@
+#ifndef _FIX_WINBASE_H
+#define _FIX_WINBASE_H 1
+
+#define NTDDK_VERSION NTDDI_VERSION
+
+#include_next <winbase.h>
+
+#endif
diff --git a/src/etc/mingw-fix-include/winsock2.h b/src/etc/mingw-fix-include/winsock2.h
new file mode 100644
index 00000000000..36b58dcd1ee
--- /dev/null
+++ b/src/etc/mingw-fix-include/winsock2.h
@@ -0,0 +1,12 @@
+#ifndef _FIX_WINSOCK2_H
+#define _FIX_WINSOCK2_H 1
+
+#include_next <winsock2.h>
+
+typedef struct pollfd {
+  SOCKET fd;
+  short  events;
+  short  revents;
+} WSAPOLLFD, *PWSAPOLLFD, *LPWSAPOLLFD;
+
+#endif
diff --git a/src/test/run-pass/extern-pass-TwoU64s-ref.rs b/src/test/run-pass/extern-pass-TwoU64s-ref.rs
index 1937c366831..ed9871b5edb 100644
--- a/src/test/run-pass/extern-pass-TwoU64s-ref.rs
+++ b/src/test/run-pass/extern-pass-TwoU64s-ref.rs
@@ -9,6 +9,7 @@
 // except according to those terms.
 
 // Test that we ignore modes when calling extern functions.
+// xfail-fast #9205
 
 #[deriving(Eq)]
 struct TwoU64s {
diff --git a/src/test/run-pass/extern-pass-TwoU64s.rs b/src/test/run-pass/extern-pass-TwoU64s.rs
index b543099b3b8..772970ce8a3 100644
--- a/src/test/run-pass/extern-pass-TwoU64s.rs
+++ b/src/test/run-pass/extern-pass-TwoU64s.rs
@@ -14,6 +14,7 @@
 // xfail-fast This works standalone on windows but not with check-fast.
 // possibly because there is another test that uses this extern fn but gives it
 // a different signature
+// xfail-fast #9205
 
 #[deriving(Eq)]
 struct TwoU64s {
diff --git a/src/test/run-pass/extern-return-TwoU64s.rs b/src/test/run-pass/extern-return-TwoU64s.rs
index 4dc31d71526..7fcbe3670fc 100644
--- a/src/test/run-pass/extern-return-TwoU64s.rs
+++ b/src/test/run-pass/extern-return-TwoU64s.rs
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// xfail-fast #9205
+
 struct TwoU64s {
     one: u64, two: u64
 }
diff --git a/src/test/run-pass/struct-return.rs b/src/test/run-pass/struct-return.rs
index 3f63902eb31..a1f5a2392b1 100644
--- a/src/test/run-pass/struct-return.rs
+++ b/src/test/run-pass/struct-return.rs
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// xfail-fast #9205
+
 pub struct Quad { a: u64, b: u64, c: u64, d: u64 }
 pub struct Floats { a: f64, b: u8, c: f64 }