<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
  <META NAME="GENERATOR" CONTENT="GtkHTML/3.18.3">
</HEAD>
<BODY>
On Mon, 2008-08-04 at 03:52 -0400, mp wrote:<BR>
<BLOCKQUOTE TYPE=CITE>
    Hello.  I am a new user of ANTLR and I was reading on the newsgroups about<BR>
    (the lack of) mingw support.  Anyway, the only obstacle I ran into for<BR>
    compiling on mingw was the typdefs requiring INT8/INT16/UINT8/UINT16 in<BR>
    'antlr3defs.h' (around line 82).  I am not sure where microsoft typedefs<BR>
    these, but they are not defined in any of my headers files (I am running<BR>
    GCC 4.3.0 20080305), although the 32bit versions are already typedefed in<BR>
    'basetsd.h', which gets included by way of winnt.h-&gt;windows.h. <BR>
</BLOCKQUOTE>
These are all part of the Microsoft basetsd.h file:<BR>
<BR>
typedef signed char&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; INT8, *PINT8;<BR>
typedef signed short&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; INT16, *PINT16;<BR>
typedef signed int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; INT32, *PINT32;<BR>
typedef signed __int64&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; INT64, *PINT64;<BR>
typedef unsigned char&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; UINT8, *PUINT8;<BR>
typedef unsigned short&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; UINT16, *PUINT16;<BR>
typedef unsigned int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; UINT32, *PUINT32;<BR>
typedef unsigned __int64&nbsp;&nbsp;&nbsp; UINT64, *PUINT64;<BR>
<BR>
I have not deliberately excluded mingw from being supported, but as the Microsoft compilers are freely available in .Net SDKS, then I could not see the point of anyone using mingw anymore to be honest, so I put it aside. Mingw should really have those typedefs though - see thousands of Google hits on people complaining about this.<BR>
<BR>
<BLOCKQUOTE TYPE=CITE>
     The fix is<BR>
    easy; typedef the missing types.  However, I have a suggestion to #include<BR>
    &lt;stdint.h&gt; and use the standard types defined there: int8_t, uint8_t, ...,<BR>
    uint64_t, instead of using the windows ones.  If you want, I will even do<BR>
    this for you.<BR>
</BLOCKQUOTE>
<BR>
stdint.h may be supplied with mingw, but it is not a part of the windows headers. However, I think that Mingw defines: __MINGW32__ if it is the compiler, so if stdint.h is always present when mingw is the compiler, which I believe is the case, then I can modify the headers for mingw.<BR>
<BLOCKQUOTE TYPE=CITE>
    <BR>
    So anyway, after this one easy thing to fix, everything runs fine with<BR>
    mingw.&nbsp; I used msys to run the configure script. <BR>
</BLOCKQUOTE>
<BR>
I thought that mingw was designed to compile windows code - hence you need to run configure on cygwin, but not if using mingw as the antlr3config.h is not required in Windows systems.<BR>
<BR>
I have changed the headers to reflect Mingw support - perhaps you can ask the people that support mingw to update their typedefs?<BR>
<BR>
Jim<BR>
<BR>
<PRE>


</PRE>
</BODY>
</HTML>