Merged 1.0 branch into main.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@9548 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
fedor 2001-04-10 03:27:01 +00:00
parent 04be1df225
commit 9628d301e9
42 changed files with 1313 additions and 514 deletions

View file

@ -54,6 +54,14 @@ ADDITIONAL_LDFLAGS =
# Additional library directories the linker should search
ADDITIONAL_LIB_DIRS = -L../Source/$(GNUSTEP_OBJ_DIR)
ifeq ($(GNUSTEP_TARGET_OS),mingw32)
BUNDLE_LIBS += -lgnustep-base -lobjc
endif
ifeq ($(GNUSTEP_TARGET_OS),cygwin)
BUNDLE_LIBS += -lgnustep-base -lobjc
endif
#
# Flags dealing with installing and uninstalling
#

View file

@ -2,9 +2,10 @@
#include <stdio.h>
#if 0
#if 1
int main ()
{
id pool = [NSAutoreleasePool new];
id o = [NSObject new];
printf ("Hello from object at 0x%x\n", (unsigned)[o self]);
exit (0);

View file

@ -14,7 +14,7 @@ main()
id o1, o2, o3;
unsigned int p;
behavior_set_debug(0);
//behavior_set_debug(0);
[NSAutoreleasePool enableDoubleReleaseCheck:YES];
pool = [[NSAutoreleasePool alloc] init];

View file

@ -14,18 +14,24 @@
#include "Foundation/NSException.h"
#include "Foundation/NSString.h"
#include <Foundation/NSAutoreleasePool.h>
#include <Foundation/NSProcessInfo.h>
#include "LoadMe.h"
#include "SecondClass.h"
#include "MyCategory.h"
int
main(int ac, char *av[])
main(int argc, char *argv[], char **env)
{
NSBundle *main;
NSBundle *bundle;
NSString *path;
id object;
NSAutoreleasePool *arp = [NSAutoreleasePool new];
NSAutoreleasePool *arp;
#if LIB_FOUNDATION_LIBRARY || defined(GS_PASS_ARGUMENTS)
[NSProcessInfo initializeWithArguments:argv count:argc environment:env];
#endif
arp = [NSAutoreleasePool new];
main = [NSBundle mainBundle];
printf("Looking for main bundle...\n");

View file

@ -21,7 +21,7 @@ main()
id a, b, c, e; /* dates */
id pool;
behavior_set_debug(0);
//behavior_set_debug(0);
pool = [[NSAutoreleasePool alloc] init];

View file

@ -47,7 +47,7 @@ main(int argc, char** argv, char** envp)
printf("%s ", [b cString]);
printf("\n");
behavior_set_debug(0);
//behavior_set_debug(0);
objects = [NSArray arrayWithObjects:
@"vache", @"poisson", @"cheval", @"poulet", nil];

View file

@ -9,6 +9,7 @@
#include <Foundation/NSException.h>
#include <Foundation/NSString.h>
#include <Foundation/NSThread.h>
#include <Foundation/NSAutoreleasePool.h>
#define N 10 /* Number of threads */
#define MAX_ITER 10000.0 /* Max number of iterations. */
@ -36,19 +37,23 @@ FILE *file;
- (void)runWith: (id)thing
{
int i, n;
CREATE_AUTORELEASE_POOL(pool);
NS_DURING
n = 1+(int)((MAX_ITER*rand())/(RAND_MAX+1.0));
fflush(stdout);
for (i = 0; i < n; i++)
{
fprintf(file, "%d ", i);
fflush(file);
}
fflush(stdout);
[NSException raise: @"Some exception" format: @"thread %d", ident];
NS_HANDLER
printf("%s: %s for thread %d\n", [[localException name] cString],
[[localException reason] cString], ident);
NS_ENDHANDLER
DESTROY(pool);
[NSThread exit];
}
@ -58,6 +63,7 @@ int main()
{
int i;
SingleThread *threads[N];
CREATE_AUTORELEASE_POOL(pool);
printf("We run %d threads.\n", N);
printf("Some of them might not raise exceptions,\n");
@ -81,5 +87,6 @@ int main()
printf("There's a runaway exception! Something is wrong!\n");
NS_ENDHANDLER
fclose(file);
DESTROY(pool);
return 0;
}