Author: mlytwyn
Date: Fri Sep 23 21:56:29 2016
New Revision: 40104
URL: http://svn.gna.org/viewcvs/gnustep?rev=40104&view=rev
Log:
Merge with base trunk revision 40072
Modified:
libs/base/branches/gnustep_testplant_branch/Source/NSPage.m
libs/base/branches/gnustep_testplant_branch/Source/NSPipe.m
libs/base/branches/gnustep_testplant_branch/Source/NSPortCoder.m
libs/base/branches/gnustep_testplant_branch/Source/NSProcessInfo.m
libs/base/branches/gnustep_testplant_branch/Source/NSProxy.m
libs/base/branches/gnustep_testplant_branch/Source/NSRange.m
libs/base/branches/gnustep_testplant_branch/Source/NSRunLoop.m
Modified: libs/base/branches/gnustep_testplant_branch/Source/NSPage.m
URL:
http://svn.gna.org/viewcvs/gnustep/libs/base/branches/gnustep_testplant_branch/Source/NSPage.m?rev=40104&r1=40103&r2=40104&view=diff
==============================================================================
--- libs/base/branches/gnustep_testplant_branch/Source/NSPage.m (original)
+++ libs/base/branches/gnustep_testplant_branch/Source/NSPage.m Fri Sep 23
21:56:29 2016
@@ -35,7 +35,7 @@
#include <malloc.h>
#endif
-#ifdef __MINGW__
+#ifdef _WIN32
#include <malloc.h>
static size_t
getpagesize(void)
@@ -132,7 +132,7 @@
if ((sysinfo(&info)) != 0)
return 0;
return info.freeram;
-#elif defined(__MINGW__)
+#elif defined(_WIN32)
MEMORYSTATUSEX memory;
memory.dwLength = sizeof(memory);
@@ -160,7 +160,7 @@
{
NSUInteger size = NSRoundUpToMultipleOfPageSize (bytes);
void *where;
-#if defined(__MINGW__)
+#if defined(_WIN32)
where = VirtualAlloc(NULL, size, MEM_RESERVE|MEM_COMMIT, PAGE_READWRITE);
#elif __mach__
kern_return_t r;
@@ -189,7 +189,7 @@
void
NSDeallocateMemoryPages (void *ptr, NSUInteger bytes)
{
-#if defined(__MINGW__)
+#if defined(_WIN32)
VirtualFree(ptr, 0, MEM_RELEASE);
#elif __mach__
vm_deallocate (mach_task_self (), ptr, NSRoundUpToMultipleOfPageSize
(bytes));
Modified: libs/base/branches/gnustep_testplant_branch/Source/NSPipe.m
URL:
http://svn.gna.org/viewcvs/gnustep/libs/base/branches/gnustep_testplant_branch/Source/NSPipe.m?rev=40104&r1=40103&r2=40104&view=diff
==============================================================================
--- libs/base/branches/gnustep_testplant_branch/Source/NSPipe.m (original)
+++ libs/base/branches/gnustep_testplant_branch/Source/NSPipe.m Fri Sep 23
21:56:29 2016
@@ -64,7 +64,7 @@
self = [super init];
if (self != nil)
{
-#ifndef __MINGW__
+#ifndef _WIN32
int p[2];
if (pipe(p) == 0)
Modified: libs/base/branches/gnustep_testplant_branch/Source/NSPortCoder.m
URL:
http://svn.gna.org/viewcvs/gnustep/libs/base/branches/gnustep_testplant_branch/Source/NSPortCoder.m?rev=40104&r1=40103&r2=40104&view=diff
==============================================================================
--- libs/base/branches/gnustep_testplant_branch/Source/NSPortCoder.m
(original)
+++ libs/base/branches/gnustep_testplant_branch/Source/NSPortCoder.m Fri Sep
23 21:56:29 2016
@@ -63,13 +63,6 @@
#define GSI_MAP_HASH(M, X) ((X).nsu)
#define GSI_MAP_EQUAL(M, X,Y) ((X).ptr == (Y).ptr)
#define GSI_MAP_NOCLEAN 1
-
-#if GS_WITH_GC
-#include <gc/gc_typed.h>
-static GC_descr nodeDesc; // Type descriptor for map node.
-#define GSI_MAP_NODES(M, X) \
-(GSIMapNode)GC_calloc_explicitly_typed(X, sizeof(GSIMapNode_t), nodeDesc)
-#endif
#include "GNUstepBase/GSIMap.h"
@@ -129,6 +122,9 @@
case _C_CHARPTR: return "cstring";
case _C_ARY_B: return "array";
case _C_STRUCT_B: return "struct";
+#if __GNUC__ > 2 && defined(_C_BOOL)
+ case _C_BOOL: return "_Bool";
+#endif
default:
{
static char buf1[32];
@@ -170,6 +166,7 @@
case _GSC_ULNG_LNG: return "unsigned long long";
case _GSC_FLT: return "float";
case _GSC_DBL: return "double";
+ case _GSC_BOOL: return "_Bool";
case _GSC_PTR: return "pointer";
case _GSC_CHARPTR: return "cstring";
case _GSC_ARY_B: return "array";
@@ -218,7 +215,11 @@
#endif
_C_FLT,
_C_DBL,
+#if __GNUC__ > 2 && defined(_C_BOOL)
+ _C_BOOL,
+#else
0,
+#endif
0,
0,
_C_ID,
@@ -361,14 +362,6 @@
encodingVersion = [coder systemVersion];
[coder release];
-#if GS_WITH_GC
- /* We create a typed memory descriptor for map nodes.
- */
- GC_word w[GC_BITMAP_SIZE(GSIMapNode_t)] = {0};
- GC_set_bit(w, GC_WORD_OFFSET(GSIMapNode_t, key));
- GC_set_bit(w, GC_WORD_OFFSET(GSIMapNode_t, value));
- nodeDesc = GC_make_descriptor(w, GC_WORD_LEN(GSIMapNode_t));
-#endif
connectionClass = [NSConnection class];
mutableArrayClass = [NSMutableArray class];
mutableDataClass = [NSMutableDataMalloc class];
@@ -515,6 +508,9 @@
#endif
case _C_FLT: info = _GSC_FLT; break;
case _C_DBL: info = _GSC_DBL; break;
+#if __GNUC__ > 2 && defined(_C_BOOL)
+ case _C_BOOL: info = _GSC_BOOL; break;
+#endif
default: info = _GSC_NONE; break;
}
@@ -1028,6 +1024,17 @@
}
return;
+#if __GNUC__ != 2
+ case _GSC_BOOL:
+ if (*type != type_map[_GSC_BOOL])
+ {
+ [NSException raise: NSInternalInconsistencyException
+ format: @"expected %s and got %s",
+ typeToName1(*type), typeToName2(info)];
+ }
+ (*_dDesImp)(_src, dDesSel, address, type, &_cursor, nil);
+ return;
+#endif
default:
[NSException raise: NSInternalInconsistencyException
format: @"read unknown type info - %d", info];
@@ -1200,6 +1207,9 @@
case _C_ULNG_LNG: info = _GSC_ULNG_LNG | _GSC_S_LNG_LNG; break;
case _C_FLT: info = _GSC_FLT; break;
case _C_DBL: info = _GSC_DBL; break;
+#if __GNUC__ > 2 && defined(_C_BOOL)
+ case _C_BOOL: info = _GSC_BOOL; break;
+#endif
default: info = _GSC_NONE; break;
}
@@ -1798,6 +1808,13 @@
(*_eSerImp)(_dst, eSerSel, (void*)buf, @encode(double), nil);
return;
+#if __GNUC__ > 2 && defined(_C_BOOL)
+ case _C_BOOL:
+ (*_eTagImp)(_dst, eTagSel, _GSC_BOOL);
+ (*_eSerImp)(_dst, eSerSel, (void*)buf, @encode(_Bool), nil);
+ return;
+#endif
+
case _C_VOID:
[NSException raise: NSInvalidArgumentException
format: @"can't encode void item"];
@@ -1864,14 +1881,8 @@
/*
* Set up map tables.
*/
-#if GS_WITH_GC
- _clsMap
- = (GSIMapTable)NSAllocateCollectable(sizeof(GSIMapTable_t)*4,
- NSScannedOption);
-#else
_clsMap
= (GSIMapTable)NSZoneMalloc(_zone, sizeof(GSIMapTable_t)*4);
-#endif
_cIdMap = &_clsMap[1];
_uIdMap = &_clsMap[2];
_ptrMap = &_clsMap[3];
@@ -1963,12 +1974,7 @@
*/
if (firstTime == YES)
{
-#if GS_WITH_GC
- _clsAry
- = NSAllocateCollectable(sizeof(GSIArray_t)*3, NSScannedOption);
-#else
_clsAry = NSZoneMalloc(_zone, sizeof(GSIArray_t)*3);
-#endif
_objAry = &_clsAry[1];
_ptrAry = &_clsAry[2];
GSIArrayInitWithZoneAndCapacity(_clsAry, _zone, sizeC);
Modified: libs/base/branches/gnustep_testplant_branch/Source/NSProcessInfo.m
URL:
http://svn.gna.org/viewcvs/gnustep/libs/base/branches/gnustep_testplant_branch/Source/NSProcessInfo.m?rev=40104&r1=40103&r2=40104&view=diff
==============================================================================
--- libs/base/branches/gnustep_testplant_branch/Source/NSProcessInfo.m
(original)
+++ libs/base/branches/gnustep_testplant_branch/Source/NSProcessInfo.m Fri Sep
23 21:56:29 2016
@@ -257,7 +257,7 @@
}
else
{
-#if defined(__MINGW__)
+#if defined(_WIN32)
unichar *buffer;
int buffer_size = 0;
int needed_size = 0;
@@ -301,7 +301,7 @@
/* Getting the process name */
IF_NO_GC(RELEASE(_gnu_processName));
_gnu_processName = [arg0 lastPathComponent];
-#if defined(__MINGW__)
+#if defined(_WIN32)
/* On windows we remove any .exe extension for consistency with app names
* under unix
*/
@@ -317,7 +317,7 @@
IF_NO_GC(RETAIN(_gnu_processName));
/* Copy the argument list */
-#if defined(__MINGW__)
+#if defined(_WIN32)
{
unichar **argvw = CommandLineToArgvW(GetCommandLineW(), &argc);
NSString *str;
@@ -381,7 +381,7 @@
NSMutableArray *values = [NSMutableArray new];
NSStringEncoding enc = GSPrivateDefaultCStringEncoding();
-#if defined(__MINGW__)
+#if defined(_WIN32)
if (fallbackInitialisation == NO)
{
unichar *base;
@@ -909,7 +909,7 @@
{
if (_gnu_noobjc_argv == 0 || _gnu_noobjc_env == 0)
{
- _NSLog_printf_handler(_GNU_MISSING_MAIN_FUNCTION_CALL);
+ fprintf(stderr, _GNU_MISSING_MAIN_FUNCTION_CALL);
exit(1);
}
_gnu_process_args(_gnu_noobjc_argc, _gnu_noobjc_argv, _gnu_noobjc_env);
@@ -918,7 +918,7 @@
}
#else /*! HAVE_PROCFS !HAVE_LOAD_METHOD !HAVE_KVM_ENV */
-#ifdef __MINGW__
+#ifdef _WIN32
/* For WindowsAPI Library, we know the global variables (argc, etc) */
+ (void) initialize
{
@@ -981,7 +981,7 @@
sizeof(_NSConstantStringClassReference));
#endif
-#if defined(__MINGW__)
+#if defined(_WIN32)
WSADATA lpWSAData;
// Initialize Windows Sockets
@@ -990,7 +990,7 @@
printf("Could not startup Windows Sockets\n");
exit(1);
}
-#endif /* __MINGW__ */
+#endif /* _WIN32 */
#ifdef __MS_WIN__
_MB_init_runtime();
@@ -1002,7 +1002,7 @@
return gnustep_base_user_main(argc, argv, env);
}
#endif /* !GS_PASS_ARGUMENTS */
-#endif /* __MINGW__ */
+#endif /* _WIN32 */
#endif /* HAS_LOAD_METHOD && HAS_PROCFS */
@@ -1012,7 +1012,7 @@
// We can't use NSAssert, which calls NSLog, which calls NSProcessInfo...
if (!(_gnu_processName && _gnu_arguments && _gnu_environment))
{
- _NSLog_printf_handler(_GNU_MISSING_MAIN_FUNCTION_CALL);
+ fprintf(stderr, _GNU_MISSING_MAIN_FUNCTION_CALL);
exit(1);
}
@@ -1043,7 +1043,7 @@
{
if (pid > 0)
{
-#if defined(__MINGW__)
+#if defined(_WIN32)
HANDLE h = OpenProcess(PROCESS_QUERY_INFORMATION,0,pid);
if (h == NULL && GetLastError() != ERROR_ACCESS_DENIED)
{
@@ -1077,8 +1077,8 @@
unsigned long count;
static NSString *host = nil;
NSString *thost = nil;
- static int pid;
- int tpid;
+ static int pid = 0;
+ int tpid = 0;
static unsigned long start;
/* We obtain the host name and pid outside the locked region in case
@@ -1123,7 +1123,7 @@
NSString *os = nil;
BOOL parseOS = YES;
-#if defined(__MINGW__)
+#if defined(_WIN32)
OSVERSIONINFOW osver;
osver.dwOSVersionInfoSize = sizeof(osver);
@@ -1165,7 +1165,7 @@
}
}
#endif /* HAVE_SYS_UTSNAME_H */
-#endif /* __MINGW__ */
+#endif /* _WIN32 */
if (_operatingSystemVersion == nil)
{
@@ -1283,7 +1283,7 @@
{
int pid;
-#if defined(__MINGW__)
+#if defined(_WIN32)
pid = (int)GetCurrentProcessId();
#else
pid = (int)getpid();
@@ -1313,7 +1313,7 @@
if (beenHere == NO)
{
-#if defined(__MINGW__)
+#if defined(_WIN32)
SYSTEM_INFO info;
GetSystemInfo(&info);
@@ -1369,7 +1369,7 @@
- (NSUInteger) activeProcessorCount
{
-#if defined(__MINGW__)
+#if defined(_WIN32)
SYSTEM_INFO info;
int index;
int count = 0;
@@ -1410,7 +1410,7 @@
if (beenHere == NO)
{
-#if defined(__MINGW__)
+#if defined(_WIN32)
MEMORYSTATUSEX memory;
memory.dwLength = sizeof(memory);
@@ -1491,7 +1491,7 @@
extern int _NSLogDescriptor;
int desc;
-#if defined(__MINGW__)
+#if defined(_WIN32)
desc = _wopen((wchar_t*)[path fileSystemRepresentation],
O_RDWR|O_CREAT|O_APPEND, 0644);
#else
Modified: libs/base/branches/gnustep_testplant_branch/Source/NSProxy.m
URL:
http://svn.gna.org/viewcvs/gnustep/libs/base/branches/gnustep_testplant_branch/Source/NSProxy.m?rev=40104&r1=40103&r2=40104&view=diff
==============================================================================
--- libs/base/branches/gnustep_testplant_branch/Source/NSProxy.m
(original)
+++ libs/base/branches/gnustep_testplant_branch/Source/NSProxy.m Fri Sep
23 21:56:29 2016
@@ -217,9 +217,7 @@
*/
- (id) autorelease
{
-#if GS_WITH_GC == 0
[NSAutoreleasePool addObject: self];
-#endif
return self;
}
@@ -455,7 +453,6 @@
*/
- (oneway void) release
{
-#if (GS_WITH_GC == 0)
if (NSDecrementExtraRefCountWasZero(self))
{
# ifdef OBJC_CAP_ARC
@@ -463,7 +460,6 @@
# endif
[self dealloc];
}
-#endif
}
/**
Modified: libs/base/branches/gnustep_testplant_branch/Source/NSRange.m
URL:
http://svn.gna.org/viewcvs/gnustep/libs/base/branches/gnustep_testplant_branch/Source/NSRange.m?rev=40104&r1=40103&r2=40104&view=diff
==============================================================================
--- libs/base/branches/gnustep_testplant_branch/Source/NSRange.m
(original)
+++ libs/base/branches/gnustep_testplant_branch/Source/NSRange.m Fri Sep
23 21:56:29 2016
@@ -1,5 +1,5 @@
/** NSRange - range functions
- * Copyright (C) 1993, 1994, 1995 Free Software Foundation, Inc.
+ * Copyright (C) 1993-2015 Free Software Foundation, Inc.
*
* Written by: Adam Fedor <[email protected]>
* Date: Mar 1995
@@ -36,10 +36,10 @@
static Class NSStringClass = 0;
static Class NSScannerClass = 0;
-static SEL scanIntSel;
+static SEL scanIntegerSel;
static SEL scanStringSel;
static SEL scannerSel;
-static BOOL (*scanIntImp)(NSScanner*, SEL, int*);
+static BOOL (*scanIntegerImp)(NSScanner*, SEL, NSInteger*);
static BOOL (*scanStringImp)(NSScanner*, SEL, NSString*, NSString**);
static id (*scannerImp)(Class, SEL, NSString*);
@@ -50,11 +50,11 @@
{
NSStringClass = [NSString class];
NSScannerClass = [NSScanner class];
- scanIntSel = @selector(scanInt:);
+ scanIntegerSel = @selector(scanInteger:);
scanStringSel = @selector(scanString:intoString:);
scannerSel = @selector(scannerWithString:);
- scanIntImp = (BOOL (*)(NSScanner*, SEL, int*))
- [NSScannerClass instanceMethodForSelector: scanIntSel];
+ scanIntegerImp = (BOOL (*)(NSScanner*, SEL, NSInteger*))
+ [NSScannerClass instanceMethodForSelector: scanIntegerSel];
scanStringImp = (BOOL (*)(NSScanner*, SEL, NSString*, NSString**))
[NSScannerClass instanceMethodForSelector: scanStringSel];
scannerImp = (id (*)(Class, SEL, NSString*))
@@ -73,11 +73,11 @@
if ((*scanStringImp)(scanner, scanStringSel, @"{", NULL)
&& (*scanStringImp)(scanner, scanStringSel, @"location", NULL)
&& (*scanStringImp)(scanner, scanStringSel, @"=", NULL)
- && (*scanIntImp)(scanner, scanIntSel, (int*)&range.location)
+ && (*scanIntegerImp)(scanner, scanIntegerSel, (NSInteger*)&range.location)
&& (*scanStringImp)(scanner, scanStringSel, @",", NULL)
&& (*scanStringImp)(scanner, scanStringSel, @"length", NULL)
&& (*scanStringImp)(scanner, scanStringSel, @"=", NULL)
- && (*scanIntImp)(scanner, scanIntSel, (int*)&range.length)
+ && (*scanIntegerImp)(scanner, scanIntegerSel, (NSInteger*)&range.length)
&& (*scanStringImp)(scanner, scanStringSel, @"}", NULL))
return range;
else
Modified: libs/base/branches/gnustep_testplant_branch/Source/NSRunLoop.m
URL:
http://svn.gna.org/viewcvs/gnustep/libs/base/branches/gnustep_testplant_branch/Source/NSRunLoop.m?rev=40104&r1=40103&r2=40104&view=diff
==============================================================================
--- libs/base/branches/gnustep_testplant_branch/Source/NSRunLoop.m
(original)
+++ libs/base/branches/gnustep_testplant_branch/Source/NSRunLoop.m Fri Sep
23 21:56:29 2016
@@ -240,13 +240,8 @@
#ifndef GSI_ARRAY_TYPES
#define GSI_ARRAY_TYPES GSUNION_OBJ
-#if GS_WITH_GC == 0
#define GSI_ARRAY_RELEASE(A, X) [(X).obj release]
#define GSI_ARRAY_RETAIN(A, X) [(X).obj retain]
-#else
-#define GSI_ARRAY_RELEASE(A, X)
-#define GSI_ARRAY_RETAIN(A, X)
-#endif
#include "GNUstepBase/GSIArray.h"
#endif
@@ -554,12 +549,8 @@
NSObjectMapValueCallBacks, 0);
_timedPerformers = [[NSMutableArray alloc] initWithCapacity: 8];
#ifdef HAVE_POLL_F
-#if GS_WITH_GC
- _extra = NSAllocateCollectable(sizeof(pollextra), NSScannedOption);
-#else
_extra = NSZoneMalloc(NSDefaultMallocZone(), sizeof(pollextra));
memset(_extra, '\0', sizeof(pollextra));
-#endif
#endif
}
return self;
@@ -1113,12 +1104,10 @@
when = theFuture;
}
}
-#if !GS_WITH_GC
else
{
AUTORELEASE(when);
}
-#endif
NSDebugMLLog(@"NSRunLoop", @"limit date %f in %@",
nil == when ? 0.0 : [when timeIntervalSinceReferenceDate], mode);
_______________________________________________
Gnustep-cvs mailing list
[email protected]
https://mail.gna.org/listinfo/gnustep-cvs