This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] include _mingw.h in stddef.h
- From: Ozkan Sezer <sezeroz at gmail dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: Kai Tietz <ktietz70 at googlemail dot com>, Richard Henderson <rth at redhat dot com>
- Date: Thu, 17 Sep 2009 16:00:23 +0300
- Subject: [PATCH] include _mingw.h in stddef.h
Hello:
$ cat dummy.c
#include <stddef.h>
__int64 dummy;
Without the following patch, the above example shall not compile for
mingw* because certain types such as __int64 in the above example
(and some definitions) which are provided by the M$ compiler, are not
available via including gcc-provided stddef.h. They are, however,
provided by _mingw.h which is available for both mingw32 (mingw.org)
and mingw-w64. By including _mingw.h at the top of stddef.h, the
problem can easily be solved.
OK for trunk and for the 4.4 branch? (I don't have svn write access.)
--
Ozkan
--- gcc/ginclude/stddef.h~
+++ gcc/ginclude/stddef.h
@@ -25,6 +25,11 @@
/*
* ISO C Standard: 7.17 Common definitions <stddef.h>
*/
+
+#if defined(__MINGW32__) || defined(__MINGW64__)
+#include <_mingw.h>
+#endif
+
#if (!defined(_STDDEF_H) && !defined(_STDDEF_H_) && !defined(_ANSI_STDDEF_H) \
&& !defined(__STDDEF_H__)) \
|| defined(__need_wchar_t) || defined(__need_size_t) \