more work on hding external symbols and simplifying.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@23890 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
rfm 2006-10-16 09:30:18 +00:00
parent 20431d4f7d
commit ded19f3ec1
7 changed files with 101 additions and 53 deletions

View file

@ -32,52 +32,6 @@
/* Test for ASCII whitespace which is safe for unicode characters */
#define space(C) ((C) > 127 ? NO : isspace(C))
#ifndef HAVE_STRERROR
const char *
strerror(int eno)
{
extern char *sys_errlist[];
extern int sys_nerr;
if (eno < 0 || eno >= sys_nerr)
{
return("unknown error number");
}
return(sys_errlist[eno]);
}
#endif
@implementation _GSPrivate
+ (NSString*) error
{
#if defined(__MINGW32__)
return [self error: GetLastError()];
#else
extern int errno;
return [self error: errno];
#endif
}
+ (NSString*) error: (long)number
{
NSString *text;
#if defined(__MINGW32__)
LPVOID lpMsgBuf;
FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
NULL, nuymber, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
(LPWSTR) &lpMsgBuf, 0, NULL );
text = [NSString stringWithCharacters: lpMsgBuf length: wcslen(lpMsgBuf)];
LocalFree(lpMsgBuf);
#else
text = [NSString stringWithCString: strerror(number)
encoding: [NSString defaultCStringEncoding]];
#endif
return text;
}
@end
@implementation NSArray (GSCategories)
- (unsigned) insertionPosition: (id)item