mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 08:21:25 +00:00
Fixup some conditional compilation to use __MINGW32__
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@22535 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
5c5a0b2e4b
commit
eff71248f2
6 changed files with 30 additions and 28 deletions
|
@ -3,6 +3,12 @@
|
||||||
* Source/Additions/GSXML.m: Fix parsing error .. was not recognising
|
* Source/Additions/GSXML.m: Fix parsing error .. was not recognising
|
||||||
base64 elements.
|
base64 elements.
|
||||||
* Headers/Foundation/NSPathUtilitites.h: Expand config documentation
|
* Headers/Foundation/NSPathUtilitites.h: Expand config documentation
|
||||||
|
* NSTimeZone.m:
|
||||||
|
* NSPathUtilities.m:
|
||||||
|
* NSPage.m:
|
||||||
|
* NSException.m:
|
||||||
|
* NSLog.m:
|
||||||
|
Fix some MINGW32 conditional compilation to use __MINGW32__
|
||||||
|
|
||||||
2006-02-21 Richard Frith-Macdonald <rfm@gnu.org>
|
2006-02-21 Richard Frith-Macdonald <rfm@gnu.org>
|
||||||
|
|
||||||
|
|
|
@ -276,7 +276,7 @@ _NSAddHandler (NSHandler* handler)
|
||||||
NSThread *thread;
|
NSThread *thread;
|
||||||
|
|
||||||
thread = GSCurrentThread();
|
thread = GSCurrentThread();
|
||||||
#if defined(__WIN32__) && defined(DEBUG)
|
#if defined(__MINGW32__) && defined(DEBUG)
|
||||||
if (thread->_exception_handler
|
if (thread->_exception_handler
|
||||||
&& IsBadReadPtr(thread->_exception_handler, sizeof(NSHandler)))
|
&& IsBadReadPtr(thread->_exception_handler, sizeof(NSHandler)))
|
||||||
{
|
{
|
||||||
|
@ -299,7 +299,7 @@ _NSRemoveHandler (NSHandler* handler)
|
||||||
fprintf(stderr, "ERROR: Removing exception handler that is not on top "
|
fprintf(stderr, "ERROR: Removing exception handler that is not on top "
|
||||||
"of the stack. (You probably called return in an NS_DURING block.)\n");
|
"of the stack. (You probably called return in an NS_DURING block.)\n");
|
||||||
}
|
}
|
||||||
#if defined(__WIN32__)
|
#if defined(__MINGW32__)
|
||||||
if (IsBadReadPtr(handler, sizeof(NSHandler)))
|
if (IsBadReadPtr(handler, sizeof(NSHandler)))
|
||||||
{
|
{
|
||||||
fprintf(stderr, "ERROR: Could not remove exception handler, "
|
fprintf(stderr, "ERROR: Could not remove exception handler, "
|
||||||
|
|
|
@ -108,7 +108,7 @@ _NSLog_standard_printf_handler (NSString* message)
|
||||||
NSData *d;
|
NSData *d;
|
||||||
const char *buf;
|
const char *buf;
|
||||||
unsigned len;
|
unsigned len;
|
||||||
#if defined(__WIN32__)
|
#if defined(__MINGW32__)
|
||||||
LPCWSTR null_terminated_buf;
|
LPCWSTR null_terminated_buf;
|
||||||
#else
|
#else
|
||||||
#if defined(HAVE_SYSLOG)
|
#if defined(HAVE_SYSLOG)
|
||||||
|
@ -139,7 +139,7 @@ _NSLog_standard_printf_handler (NSString* message)
|
||||||
len = [d length];
|
len = [d length];
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(__WIN32__)
|
#if defined(__MINGW32__)
|
||||||
null_terminated_buf = UNISTR(message);
|
null_terminated_buf = UNISTR(message);
|
||||||
|
|
||||||
OutputDebugStringW(null_terminated_buf);
|
OutputDebugStringW(null_terminated_buf);
|
||||||
|
@ -184,7 +184,7 @@ _NSLog_standard_printf_handler (NSString* message)
|
||||||
#else
|
#else
|
||||||
write(_NSLogDescriptor, buf, len);
|
write(_NSLogDescriptor, buf, len);
|
||||||
#endif
|
#endif
|
||||||
#endif // __WIN32__
|
#endif // __MINGW32__
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -29,9 +29,6 @@
|
||||||
#include "Foundation/NSObjCRuntime.h"
|
#include "Foundation/NSObjCRuntime.h"
|
||||||
#include "Foundation/NSZone.h"
|
#include "Foundation/NSZone.h"
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#ifdef __WIN32__
|
|
||||||
#include <malloc.h>
|
|
||||||
#endif
|
|
||||||
#ifdef HAVE_UNISTD_H
|
#ifdef HAVE_UNISTD_H
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -117,7 +117,7 @@ static NSString *gnustep_flattened =
|
||||||
nil;
|
nil;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__WIN32__)
|
#if defined(__MINGW32__)
|
||||||
/*
|
/*
|
||||||
* FIXME ... should check access properly if the file is on an NTFS volume.
|
* FIXME ... should check access properly if the file is on an NTFS volume.
|
||||||
*/
|
*/
|
||||||
|
@ -663,7 +663,7 @@ ParseConfigurationFile(NSString *fileName, NSMutableDictionary *dict,
|
||||||
|
|
||||||
if ([userName isEqual: fileOwner] == NO)
|
if ([userName isEqual: fileOwner] == NO)
|
||||||
{
|
{
|
||||||
#if defined(__WIN32__)
|
#if defined(__MINGW32__)
|
||||||
fprintf(stderr, "The file '%S' is owned by '%s' but we expect it"
|
fprintf(stderr, "The file '%S' is owned by '%s' but we expect it"
|
||||||
" to be the personal config file of '%s'.\nIgnoring it.\n",
|
" to be the personal config file of '%s'.\nIgnoring it.\n",
|
||||||
[fileName fileSystemRepresentation],
|
[fileName fileSystemRepresentation],
|
||||||
|
@ -679,7 +679,7 @@ ParseConfigurationFile(NSString *fileName, NSMutableDictionary *dict,
|
||||||
}
|
}
|
||||||
if (([attributes filePosixPermissions] & (0022 & ATTRMASK)) != 0)
|
if (([attributes filePosixPermissions] & (0022 & ATTRMASK)) != 0)
|
||||||
{
|
{
|
||||||
#if defined(__WIN32__)
|
#if defined(__MINGW32__)
|
||||||
fprintf(stderr, "The file '%S' is writable by someone other than"
|
fprintf(stderr, "The file '%S' is writable by someone other than"
|
||||||
" its owner (permissions 0%lo).\nIgnoring it.\n",
|
" its owner (permissions 0%lo).\nIgnoring it.\n",
|
||||||
[fileName fileSystemRepresentation],
|
[fileName fileSystemRepresentation],
|
||||||
|
@ -968,7 +968,7 @@ GSSetUserName(NSString *aName)
|
||||||
NSString *
|
NSString *
|
||||||
NSUserName(void)
|
NSUserName(void)
|
||||||
{
|
{
|
||||||
#if defined(__WIN32__)
|
#if defined(__MINGW32__)
|
||||||
if (theUserName == nil)
|
if (theUserName == nil)
|
||||||
{
|
{
|
||||||
/* Use the LOGNAME environment variable if set. */
|
/* Use the LOGNAME environment variable if set. */
|
||||||
|
@ -1108,7 +1108,7 @@ NSHomeDirectoryForUser(NSString *loginName)
|
||||||
NSString *
|
NSString *
|
||||||
NSFullUserName(void)
|
NSFullUserName(void)
|
||||||
{
|
{
|
||||||
#if defined(__WIN32__)
|
#if defined(__MINGW32__)
|
||||||
/* FIXME: Win32 way to get full user name via Net API */
|
/* FIXME: Win32 way to get full user name via Net API */
|
||||||
return NSUserName();
|
return NSUserName();
|
||||||
#else
|
#else
|
||||||
|
@ -1210,7 +1210,7 @@ NSTemporaryDirectory(void)
|
||||||
int perm;
|
int perm;
|
||||||
int owner;
|
int owner;
|
||||||
BOOL flag;
|
BOOL flag;
|
||||||
#if !defined(__WIN32__)
|
#if !defined(__MINGW32__)
|
||||||
int uid;
|
int uid;
|
||||||
#else
|
#else
|
||||||
unichar buffer[1024];
|
unichar buffer[1024];
|
||||||
|
@ -1237,12 +1237,10 @@ NSTemporaryDirectory(void)
|
||||||
baseTempDirName = [env objectForKey: @"TMP"];
|
baseTempDirName = [env objectForKey: @"TMP"];
|
||||||
if (baseTempDirName == nil)
|
if (baseTempDirName == nil)
|
||||||
{
|
{
|
||||||
#if defined(__MINGW32__)
|
#if defined(__CYGWIN__)
|
||||||
#ifdef __CYGWIN__
|
|
||||||
baseTempDirName = @"/cygdrive/c/";
|
baseTempDirName = @"/cygdrive/c/";
|
||||||
#else
|
#elif defined(__MINGW32__)
|
||||||
baseTempDirName = @"/c/";
|
baseTempDirName = @"C:\\";
|
||||||
#endif
|
|
||||||
#else
|
#else
|
||||||
baseTempDirName = @"/tmp";
|
baseTempDirName = @"/tmp";
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -199,7 +199,7 @@ typedef struct {
|
||||||
}
|
}
|
||||||
@end
|
@end
|
||||||
|
|
||||||
#if defined(__WIN32__)
|
#if defined(__MINGW32__)
|
||||||
@interface GSWindowsTimeZone : NSTimeZone
|
@interface GSWindowsTimeZone : NSTimeZone
|
||||||
{
|
{
|
||||||
@public
|
@public
|
||||||
|
@ -423,7 +423,7 @@ static NSString *_time_zone_path(NSString *subpath, NSString *type)
|
||||||
fileName = [NSTimeZoneClass getTimeZoneFile: name];
|
fileName = [NSTimeZoneClass getTimeZoneFile: name];
|
||||||
if (fileName == nil
|
if (fileName == nil
|
||||||
|| ![[NSFileManager defaultManager] fileExistsAtPath: fileName])
|
|| ![[NSFileManager defaultManager] fileExistsAtPath: fileName])
|
||||||
#if defined(__WIN32__)
|
#if defined(__MINGW32__)
|
||||||
{
|
{
|
||||||
zone = [[GSWindowsTimeZone alloc] initWithName: name data: 0];
|
zone = [[GSWindowsTimeZone alloc] initWithName: name data: 0];
|
||||||
RELEASE(self);
|
RELEASE(self);
|
||||||
|
@ -437,7 +437,7 @@ static NSString *_time_zone_path(NSString *subpath, NSString *type)
|
||||||
#endif
|
#endif
|
||||||
data = [NSData dataWithContentsOfFile: fileName];
|
data = [NSData dataWithContentsOfFile: fileName];
|
||||||
}
|
}
|
||||||
#if defined(__WIN32__)
|
#if defined(__MINGW32__)
|
||||||
if (!data)
|
if (!data)
|
||||||
zone = [[GSWindowsTimeZone alloc] initWithName: name data: data];
|
zone = [[GSWindowsTimeZone alloc] initWithName: name data: data];
|
||||||
else
|
else
|
||||||
|
@ -1405,7 +1405,7 @@ static NSMapTable *absolutes = 0;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__WIN32__)
|
#if defined(__MINGW32__)
|
||||||
/*
|
/*
|
||||||
* Try to get timezone from windows registry.
|
* Try to get timezone from windows registry.
|
||||||
*/
|
*/
|
||||||
|
@ -1898,9 +1898,10 @@ static NSMapTable *absolutes = 0;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class serves no useful purpose in GNUstep, and is provided
|
* This class serves no useful purpose in GNUstep other than to provide
|
||||||
* solely for backward compatibility with the OpenStep spec. It is
|
* a backup mechanism for handling abbreviations where the precomputed
|
||||||
* missing entirely from MacOS-X.
|
* data files cannot be found. It is provided primarily for backward
|
||||||
|
* compatibility with the OpenStep spec. It is missing entirely from MacOS-X.
|
||||||
*/
|
*/
|
||||||
@implementation NSTimeZoneDetail
|
@implementation NSTimeZoneDetail
|
||||||
|
|
||||||
|
@ -2011,7 +2012,7 @@ static NSString *zoneDirs[] = {
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
|
||||||
#if defined(__WIN32__)
|
#if defined(__MINGW32__)
|
||||||
/* Timezone information data as stored in the registry */
|
/* Timezone information data as stored in the registry */
|
||||||
typedef struct TZI_format {
|
typedef struct TZI_format {
|
||||||
LONG Bias;
|
LONG Bias;
|
||||||
|
@ -2435,7 +2436,7 @@ int dayOfCommonEra(NSTimeInterval when);
|
||||||
return timeZoneName;
|
return timeZoneName;
|
||||||
}
|
}
|
||||||
@end
|
@end
|
||||||
#endif // __WIN32__
|
#endif // __MINGW32__
|
||||||
|
|
||||||
|
|
||||||
@implementation GSTimeZone
|
@implementation GSTimeZone
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue