root/lang/objective-cplusplus/i3/trunk/src/mil/include/mil/StaticDataObjC.cpp @ 36260

Revision 36260, 0.9 kB (checked in by saturday06, 4 years ago)

aoaoaooaoaooaaaaoao

  • Property svn:executable set to *
Line 
1
2#ifdef HAVE_CONFIG_H
3#include <config.h>
4#endif
5
6#import <Cocoa/Cocoa.h>
7#import <Foundation/NSException.h>
8
9#include "Thread.h"
10#include "FilterException.h"
11
12#ifdef ENABLE_NLS
13#include <libintl.h>
14#else
15#define gettext(x) x
16#endif
17
18#undef filter_exception_and_start
19
20int filter_exception_and_start_objc(int argc, char** argv, int (*start)(int, char**)) {
21    int result = EXIT_FAILURE;
22
23    NS_DURING
24    {
25        NSAutoreleasePool* pool = [NSAutoreleasePool alloc];
26        [pool init];
27        result = filter_exception_and_start(argc, argv, start);
28    }
29    NS_HANDLER
30    {
31        fprintf(stderr, gettext("Objective-C Exception, name=[%s] reason=[%s]\n"), [[localException name] cString], [[localException reason] cString]);
32    }
33    NS_ENDHANDLER
34
35    return result;
36}
37
38@implementation WorkerThread
39- (void)setData:
40(void* (*)(void*))routine_ arg:
41(void*)arg_ {
42    routine = routine_;
43    arg = arg_;
44}
45- (void)start {
46    routine(arg);
47}
48@end
49
Note: See TracBrowser for help on using the browser.