comparison runtime/internal/mars.h @ 443:44f08170f4ef

Removed tango from the repository and instead added a runtime dir with the files needed to patch and build tango from svn. Reworked the LLVMDC specific pragmas.
author Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
date Fri, 01 Aug 2008 00:32:06 +0200
parents
children 635f91212b78
comparison
equal deleted inserted replaced
442:76078c8ab5b9 443:44f08170f4ef
1
2 /*
3 * Placed into the Public Domain
4 * written by Walter Bright, Digital Mars
5 * www.digitalmars.com
6 */
7
8 /*
9 * Modified by Sean Kelly <sean@f4.ca> for use with Tango.
10 */
11
12 #include <stddef.h>
13
14 #if __cplusplus
15 extern "C" {
16 #endif
17
18 struct ClassInfo;
19 struct Vtbl;
20
21 typedef struct Vtbl
22 {
23 size_t len;
24 void **vptr;
25 } Vtbl;
26
27 typedef struct Interface
28 {
29 struct ClassInfo *classinfo;
30 struct Vtbl vtbl;
31 int offset;
32 } Interface;
33
34 typedef struct Object
35 {
36 void **vptr;
37 void *monitor;
38 } Object;
39
40 typedef struct ClassInfo
41 {
42 Object object;
43
44 size_t initlen;
45 void *init;
46
47 size_t namelen;
48 char *name;
49
50 Vtbl vtbl;
51
52 size_t interfacelen;
53 Interface *interfaces;
54
55 struct ClassInfo *baseClass;
56
57 void *destructor;
58 void *invariant;
59
60 int flags;
61 } ClassInfo;
62
63 typedef struct Exception
64 {
65 Object object;
66
67 size_t msglen;
68 char* msg;
69
70 size_t filelen;
71 char* file;
72
73 size_t line;
74
75 struct Interface *info;
76 struct Exception *next;
77 } Exception;
78
79 typedef struct Array
80 {
81 size_t length;
82 void *ptr;
83 } Array;
84
85 typedef struct Delegate
86 {
87 void *thisptr;
88 void (*funcptr)();
89 } Delegate;
90
91 void _d_monitorenter(Object *h);
92 void _d_monitorexit(Object *h);
93
94 int _d_isbaseof(ClassInfo *b, ClassInfo *c);
95 Object *_d_dynamic_cast(Object *o, ClassInfo *ci);
96
97 Object * _d_newclass(ClassInfo *ci);
98 void _d_delclass(Object **p);
99
100 void _d_OutOfMemory();
101
102 #if __cplusplus
103 }
104 #endif
105