Mercurial > hg > Members > kono > tree_dandy2
view debug.h @ 21:b7654db65a34
add TODO
author | koba <koba@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 10 Dec 2010 19:04:17 +0900 |
parents | 972a7f233b23 |
children |
line wrap: on
line source
#ifndef __debug_h #define __debug_h #if 0 extern code(*abort_ptr) (); #define SET_ABORT(x) code (*abort_ptr)()=(x) extern code dbg_abort(int errcode); // #define DEBUG_ABORT(errcode) {goto dbg_abort(errcode);} extern void print_profile(); #ifndef ALLOC_STACK #include"stack.h" #endif extern Stack current_sp; extern Stack stack_peak; #undef ALLOC_STACK #define ALLOC_STACK(sp,size) {\ (sp)-=(size);\ current_sp=(sp);\ if(sp<stack_peak){\ stack_peak=sp;\ }\ if((sp)<general_stack){\ goto dbg_abort(2);\ }\ } #undef FREE_STACK #define FREE_STACK(sp,size) {\ (sp)+=(size);\ current_sp=(sp);\ if((sp)>Stacklast){\ goto dbg_abort(3);\ }\ } #endif extern void dbg_init(const char *); extern int dbg_printf(const char *, ...); #ifdef USE_MYRAND extern int myrand(void); extern int myrand_open_file(char *); #define rand myrand #else #define myrand_open_file(f) (0) #endif #endif // __debug_h