mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 00:41:02 +00:00
Tidyups and fixes for windows.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@14458 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
682ec1c5aa
commit
8453f2c2f8
2 changed files with 23 additions and 2 deletions
|
@ -911,7 +911,28 @@ failure:
|
|||
IF_NO_GC(TEST_AUTORELEASE(att));
|
||||
}
|
||||
|
||||
#if defined(__NEW__MINGW__)
|
||||
if (ReplaceFile(theRealPath, thePath, 0,
|
||||
REPLACEFILE_IGNORE_MERGE_ERRORS, 0, 0) != 0)
|
||||
{
|
||||
c = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
c = -1;
|
||||
}
|
||||
#else
|
||||
c = rename(thePath, theRealPath);
|
||||
#if defined(__MINGW__)
|
||||
if (c != 0)
|
||||
{
|
||||
NSLog(@"Rename ('%s' to '%s') failed - %s trying delete first.",
|
||||
thePath, theRealPath, GSLastErrorStr(errno));
|
||||
DeleteFile(theRealPath); // Non-atomic!
|
||||
c = rename(thePath, theRealPath);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
if (c != 0) /* Many things could go wrong, I guess. */
|
||||
{
|
||||
NSLog(@"Rename ('%s' to '%s') failed - %s",
|
||||
|
|
|
@ -165,7 +165,7 @@
|
|||
@interface GSAttrDictionary : NSDictionary
|
||||
{
|
||||
#ifdef __MINGW__
|
||||
const char *name;
|
||||
char *name;
|
||||
#endif
|
||||
struct stat statbuf;
|
||||
}
|
||||
|
@ -2626,7 +2626,7 @@ static NSSet *fileKeys = nil;
|
|||
{
|
||||
#ifdef __MINGW__
|
||||
if (name != 0)
|
||||
NSZoneFree(name);
|
||||
NSZoneFree(NSDefaultMallocZone(), name);
|
||||
#endif
|
||||
[super dealloc];
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue