|
From: | Christian Jullien |
Subject: | Re: [Tinycc-devel] "mormalize_inc_dirs" |
Date: | Sat, 7 Nov 2015 16:34:24 +0100 |
Since you know you’re on Windows, you can call GetFullPathName on two dirs and compare results. It is available since XP and present in kernel32 DWORD WINAPI GetFullPathName( _In_ LPCTSTR lpFileName, _In_ DWORD nBufferLength, _Out_ LPTSTR lpBuffer, _Out_ LPTSTR *lpFilePart ); See https://msdn.microsoft.com/en-us/library/windows/desktop/aa364963(v=vs.85).aspx From: address@hidden [mailto:address@hidden On Behalf Of avih To check whether or not two dirs are the same without stat, one could cdhir to each dir (from the base dir) and then getcwd. As far as I know this always returns the canonicalized path, therefore makes the two path comparable. This can work on Windows too. But let's backtrace a bit: As far as I can tell, the sequence of events was as follows: 1. seyko commits "mormalize_inc_dirs" 2. I said (and now adding: on windows 8.1 with msys2 and gcc 5.2.0): Prior to this commit, when building tcc itself (configure and make), after successfully 3. Roy Tam said: BTW this commit breaks tcc compiling itself afterwards. WinXP SP3 32bit, MinGW(tcc self compilation test) Using the compiled tcc to recompile tcc itself fails with windows.h not found. I have to reverting this commit to recover. ---------- So far, from these two comment, it's apparent that the newly built windows tcc executable does not resolve dirs the same as it used to. It's unclear whether other platforms are affected. ---------- 4. seyko responds to Toy Tam: Anyone know solution for stat? From Google: 5. (now) A discussion goes on how to compare dirs on XP. So, do we know for a fact that this is the actual problem? I.e. that the current dir resolution failure is due to missing code which needs to check if two dirs are the same? If such required dir comparison was missing from the code, then I'd expect that other platforms are affected as well. But as far as I can tell there wasn't indication for that so far. Though it's possible that other platforms are affected, but the issue doesn't affect the tcc build process on those platforms, but it does on windows. However, how come the old code did not need to compare such two dirs, and still worked correctly? If the old code was working correctly without needing to compare two actual dirs, despite it not being "n[m]ormalized", maybe it's still the better solution because it depends less on features which are harder to use reliably on different platforms? On Saturday, November 7, 2015 3:59 PM, Edmund Grimley Evans <address@hidden> wrote: > Hum! You can:
|
[Prev in Thread] | Current Thread | [Next in Thread] |