# HG changeset patch # User Frits van Bommel # Date 1242765308 -7200 # Node ID 4100c49b753ffa3f4fdcde3a8f60b2f90728edcb # Parent d1fd46bbbff70f9a12503bfa706a825ed54cf9e0 Merge some changes from Tango's object.di into the testincludes version. diff -r d1fd46bbbff7 -r 4100c49b753f tests/testincludes/object.di --- a/tests/testincludes/object.di Tue May 19 20:46:33 2009 +0200 +++ b/tests/testincludes/object.di Tue May 19 22:35:08 2009 +0200 @@ -11,13 +11,14 @@ alias typeof(cast(void*)0 - cast(void*)0) ptrdiff_t; alias size_t hash_t; +alias int equals_t; class Object { char[] toString(); hash_t toHash(); int opCmp(Object o); - int opEquals(Object o); + equals_t opEquals(Object o); interface Monitor { @@ -47,9 +48,11 @@ // 2: // has no possible pointers into GC memory // 4: // has offTi[] member // 8: // has constructors + // 32: // has typeinfo void* deallocator; OffsetTypeInfo[] offTi; void* defaultConstructor; + TypeInfo typeinfo; static ClassInfo find(char[] classname); Object create(); @@ -64,7 +67,7 @@ class TypeInfo { hash_t getHash(void *p); - int equals(void *p1, void *p2); + equals_t equals(void *p1, void *p2); int compare(void *p1, void *p2); size_t tsize(); void swap(void *p1, void *p2); @@ -165,12 +168,30 @@ class Exception : Object { + struct FrameInfo{ + long line; + ptrdiff_t iframe; + ptrdiff_t offset; + size_t address; + char[] file; + char[] func; + char[256] charBuf; + void writeOut(void delegate(char[])sink); + } + interface TraceInfo + { + int opApply( int delegate( ref FrameInfo fInfo) ); + } + char[] msg; char[] file; - size_t line; + size_t line; // long would be better + TraceInfo info; Exception next; + this(char[] msg, char[] file, long line, Exception next, TraceInfo info ); this(char[] msg, Exception next = null); - this(char[] msg, char[] file, size_t line, Exception next = null); + this(char[] msg, char[] file, long line, Exception next = null); char[] toString(); + void writeOut(void delegate(char[]) sink); }