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]

Re: [libgfortran,patch] Fix "inquire by filename" for mingw


François-Xavier Coudert wrote:
>> This patch uses Windows-specific functions (protected by #ifdef
>> __MINGW32__) to uniquely identify files. In the case where this fails
>> (happens on FAT and network filesystems), it will still resort to
>> compare filenames.
>>
>> Built and tested on i386-pc-mingw32 and x86_64-linux. OK to commit?
>>     

The patch looks OK to me, but I would like to know whether Danny Smith
or Christopher Faylor have any objections or comments as I lack
experience with mingw and Windows programming.


+  res = ((uint64_t) FileInformation.nFileIndexLow)
+        |  (((uint64_t) FileInformation.nFileIndexHigh) << 32);


MSDN states:

The identifier (low and high parts) and the volume serial number
uniquely identify a file on a single computer. To determine whether two
open handles represent the same file, combine the identifier and the
volume serial number for each file and compare them.

Should one thus not also include the dwVolumeSerialNumber ? (Does not
fit into uint64_t and is probably not very relevant, though.)*

*

+  res &= ((~(0ULL)) >> 16); /* remove sequence number */


I could not find much about this - reading MSDN this seems not to be the
case; though I would be not surprised at all if you were right.


Tobias


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