Mercurial > projects > ldc
view runtime/internal/mars.h @ 1126:899a2d90645b
Fix some issues with fawzi's patch.
- It now actually compiles:
- import stdc.stdio for string formatting functions)
- remove extra '{'
- Use snprintf() instead of sprintf().
- Use return value from snprintf instead of strlen().
- Don't print the filename in Exception.writeOut() if it has zero length and
the line number is 0
(It would previously only skip these if the filename was null, but not if it
was a different empty string)
- Ignore empty filename + line number 0 in FrameInfo.writeOut() as well.
author | Frits van Bommel <fvbommel wxs.nl> |
---|---|
date | Wed, 18 Mar 2009 15:33:19 +0100 |
parents | 635f91212b78 |
children |
line wrap: on
line source
/* * Placed into the Public Domain * written by Walter Bright, Digital Mars * www.digitalmars.com */ /* * Modified by Sean Kelly <sean@f4.ca> for use with Tango. */ #include <stddef.h> #if __cplusplus extern "C" { #endif struct ClassInfo; struct Vtbl; typedef struct Vtbl { size_t len; void **vptr; } Vtbl; typedef struct Interface { struct ClassInfo *classinfo; struct Vtbl vtbl; int offset; } Interface; typedef struct Object { void **vptr; void *monitor; } Object; typedef struct ClassInfo { Object object; size_t initlen; void *init; size_t namelen; char *name; Vtbl vtbl; size_t interfacelen; Interface *interfaces; struct ClassInfo *baseClass; void *destructor; void *invariant; int flags; } ClassInfo; typedef struct Exception { Object object; size_t msglen; char* msg; size_t filelen; char* file; size_t line; struct Interface *info; struct Exception *next; } Exception; typedef struct Array { size_t length; void *ptr; } Array; typedef struct Delegate { void *thisptr; void (*funcptr)(); } Delegate; void _d_monitorenter(Object *h); void _d_monitorexit(Object *h); int _d_isbaseof(ClassInfo *b, ClassInfo *c); Object *_d_dynamic_cast(Object *o, ClassInfo *ci); Object * _d_allocclass(ClassInfo *ci); void _d_delclass(Object **p); void _d_OutOfMemory(); #if __cplusplus } #endif