Replace missing #ifndef's.

We only process symlinks on POSIX kernels (Linux and OSX).

Fixes: lp:1548798
* https://bugs.launchpad.net/kicad/+bug/1548798
This commit is contained in:
Jeff Young 2018-07-24 08:52:33 +01:00
parent 1510c2c56f
commit f79ca271e3
2 changed files with 7 additions and 0 deletions

View File

@ -2212,6 +2212,7 @@ wxFileName SCH_LEGACY_PLUGIN_CACHE::GetRealFile() const
{
wxFileName fn( m_libFileName );
#ifndef __WINDOWS__
if( fn.Exists( wxFILE_EXISTS_SYMLINK ) )
{
char buffer[ PATH_MAX + 1 ];
@ -2224,6 +2225,7 @@ wxFileName SCH_LEGACY_PLUGIN_CACHE::GetRealFile() const
fn.Normalize();
}
}
#endif
return fn;
}

View File

@ -374,6 +374,8 @@ long long FP_CACHE::GetTimestamp()
for( MODULE_CITER it = m_modules.begin(); it != m_modules.end(); ++it )
{
wxFileName fn = it->second->GetFileName();
#ifndef __WINDOWS__
// Timestamp the source file, not the symlink
if( fn.Exists( wxFILE_EXISTS_SYMLINK ) )
{
char buffer[ PATH_MAX + 1 ];
@ -386,6 +388,7 @@ long long FP_CACHE::GetTimestamp()
fn.Normalize();
}
}
#endif
if( fn.FileExists() )
files_timestamp += fn.GetModificationTime().GetValue().GetValue();
}
@ -2119,6 +2122,7 @@ void PCB_IO::FootprintSave( const wxString& aLibraryPath, const MODULE* aFootpri
wxFileName fn( aLibraryPath, aFootprint->GetFPID().GetLibItemName(),
KiCadFootprintFileExtension );
#ifndef __WINDOWS__
// Write through symlinks, don't replace them
if( fn.Exists( wxFILE_EXISTS_SYMLINK ) )
{
@ -2132,6 +2136,7 @@ void PCB_IO::FootprintSave( const wxString& aLibraryPath, const MODULE* aFootpri
fn.Normalize();
}
}
#endif
if( !fn.IsOk() )
{