octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: getrusage for MinGW


From: John W. Eaton
Subject: Re: getrusage for MinGW
Date: Tue, 21 Mar 2006 11:26:30 -0500

On 21-Mar-2006, David Bateman wrote:

| Yes I know. The other alternative is to replace the "#if defined
| (__MINGW32__)" with "#if defined (HAVE_GETPROCESSTIMES)" and add a test
| for GetProcessTimes to configure.in. I'd prefer this to moving the code
| to sysdep.cc as I believe that would make the code less readable. The
| reason I used __MINGW32__ was to avoid having to reconfigure for a rapid
| patch. If you accept the patch, I'll try and update configure.in tonight..
| 
| >Also, is FILETIME always required to be an integer data type?  If so,
| >why do you need to cast the pointer value?  Why can't you simply write
| >
| >  tv_tmp.assign ("sec", static_cast<double> (ftKernel / 10000000U));
| >
| >?  If FILETIME is not required to be an integer data type (maybe it
| >could be defined as a pointer to some array or structure) then casting
| >the pointer is likely to cause trouble anyway, isn't it?
| >  
| >
| No this cast is needed, and is suggested on the Microsoft website.
| Though they use C style casts. With the code as you suggest I get
| 
| getrusage2.cc:204: error: no match for 'operator/' in 'ftUser / 10000000u'
| 
| As for the cast to a pointer, this is also suggested by Microsoft and
| without it I get an illegal cast.
| 
| >Finally, what file that is included by getrusage.cc gives you the
| >definitions of HANDLE and FILETIME?
| >  
| >
| Oh, damn!!! Yes I cut and paste between a linux emacs and vmware/windows
| emacs, and forgot to copy the #include.. Its in windows.h.

OK, then add the include for windows.h and add the following FIXME
above the whole mess (including the existing ifdefs for HAVE_GETRUSAGE
and HAVE_TIMES ...) and then check it in.

  // XXX FIXME XXX -- maybe encapsulate all of this in a liboctave
  // class.

Thanks,

jwe



reply via email to

[Prev in Thread] Current Thread [Next in Thread]