[MLton] Re: mingw and solaris

Wesley W. Terpstra wesley at terpstra.ca
Tue Dec 18 23:06:42 PST 2007


On Dec 18, 2007, at 9:11 AM, Bernard Berthomieu wrote:
> Matthew Fluet wrote:
>> On Mon, 17 Dec 2007, Bernard Berthomieu wrote:
>>> With the current mlton sources, you also need to patch files  
>>> runtime/platform/mingw.(h|c)
>>> as follows:
>>> in runtime/platform/mingw.h : remove declarations of timezone and  
>>> gettimeofday
>>> in runtime/platform/mingw.c : modify the type of the second  
>>> parameter of gettimeofday to (void *)
>> What version of MinGW/MSYS requires these changes?  Is there a  
>> simple way to support both the older version of MinGW and the newer?
> The current version of mingw (msys 1.0, with either gcc 3.4.5 or gcc  
> 4.2.1) defines timezone
> and gettimeofday in /mingw/include/sys/time.h, which is included by  
> runtime/platform/mingw.h.
> Older versions of mingw didn't. I don't know since when though, but  
> there is a copy of
> a 2004 mingw on my machine, that do not define these.

The current release mingw does not include gettimeofday, it's the  
snapshot versions that include it. Also, other versions of mingw  
rename the symbol in mingwex, because it conflicts with libiberty (or  
so a nearby comment said, I don't know the details).

> For future releases: If gettimeofday is kept in runtime/platform/ 
> mingw.c,
> then I think it should be modified to fit the mingw profile. Now, if  
> mingw
> provides gettimeofday (it does in libmingwex.a, as Wesley mentioned)  
> and
> if it works, why not using the mingw version of gettimeofday rather  
> than
> redefining it ?  I'll try this.

If you link with libmingwex, you will get additional symbols which  
mlton doesn't need.

The solution in my win64 patch is: #define gettimeofday
This works on all mingw versions.




More information about the MLton mailing list