127 |
#define MAX_TRAP_DEPTH 40L |
#define MAX_TRAP_DEPTH 40L |
128 |
/**< The maximum number of traps that can be nested. */ |
/**< The maximum number of traps that can be nested. */ |
129 |
|
|
130 |
ASC_DLLSPEC(jmp_buf ) g_fpe_env; /**< Standard signal jmp_buf - floating point error. */ |
#define ASC_JMP_INFO |
131 |
ASC_DLLSPEC(jmp_buf ) g_seg_env; /**< Standard signal jmp_buf - segmentation fault. */ |
/**< Whether to store additional information before making a setjmp call */ |
|
ASC_DLLSPEC(jmp_buf ) g_int_env; /**< Standard signal jmp_buf - interactive attention (<CTRL>C). */ |
|
132 |
|
|
133 |
|
#ifndef ASC_JMP_INFO |
134 |
|
# define SETJMP set_jmp |
135 |
|
# define LONGJMP longjmp |
136 |
|
typedef JMP_BUF jmp_buf |
137 |
|
#else |
138 |
|
# define SETJMP(ENV) (ENV.filename = __FILE__, ENV.line = __LINE__, ENV.func = __FUNCTION__, setjmp(ENV.jmp)) |
139 |
|
# define LONGJMP(ENV,VAL) (CONSOLE_DEBUG("LONGJMP back to %s:%d (%s)",ENV.filename,ENV.line,ENV.func), longjmp(ENV.jmp, VAL)) |
140 |
|
typedef struct{ |
141 |
|
jmp_buf jmp; |
142 |
|
const char *filename; |
143 |
|
int line; |
144 |
|
const char *func; |
145 |
|
} asc_jmp_buf; |
146 |
|
#define JMP_BUF asc_jmp_buf |
147 |
|
#endif |
148 |
|
|
149 |
|
|
150 |
|
|
151 |
|
ASC_DLLSPEC(JMP_BUF) g_fpe_env; /**< Standard signal jmp_buf - floating point error. */ |
152 |
|
ASC_DLLSPEC(JMP_BUF) g_seg_env; /**< Standard signal jmp_buf - segmentation fault. */ |
153 |
|
ASC_DLLSPEC(JMP_BUF) g_int_env; /**< Standard signal jmp_buf - interactive attention (<CTRL>C). */ |
154 |
|
|
155 |
|
#if 0 |
156 |
extern jmp_buf g_foreign_code_call_env; |
extern jmp_buf g_foreign_code_call_env; |
157 |
/**< |
/**< |
158 |
Not currently in use. Should be when we get to a unified |
Not currently in use. Should be when we get to a unified |
159 |
standard for signal handling. |
standard for signal handling. |
160 |
@todo Implement use of g_foreign_code_call_env? |
@todo Implement use of g_foreign_code_call_env? |
161 |
*/ |
*/ |
162 |
|
#endif |
163 |
|
|
164 |
ASC_DLLSPEC(void ) Asc_SignalTrap(int sigval); |
ASC_DLLSPEC(void ) Asc_SignalTrap(int sigval); |
165 |
/**< |
/**< |