about summary refs log tree commit diff
path: root/src/etc
diff options
context:
space:
mode:
authorVadim Chugunov <vadimcn@gmail.com>2013-09-17 01:06:01 -0700
committerVadim Chugunov <vadimcn@gmail.com>2013-09-17 01:06:01 -0700
commitc3fd43060306c17e47170c30e619d35bd4bdbdfb (patch)
tree763e7a8820b1339936d6112ec545c0a65755924d /src/etc
parentd1c05504ba0ec65aac73ebaac82cbac7602d0f87 (diff)
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.
Diffstat (limited to 'src/etc')
-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
4 files changed, 34 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