This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[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) \


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]