mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-29 16:01:38 +00:00
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:
parent
04be1df225
commit
9628d301e9
42 changed files with 1313 additions and 514 deletions
|
@ -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
|
||||
#
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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];
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -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];
|
||||
|
||||
|
|
|
@ -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];
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue