写的一个C语言抛出错误的代码:头文件出了有关问题,找了几次,没有解决,现向高手请问
写的一个C语言抛出异常的代码:头文件出了问题,找了几次,没有解决,现向高手请教
代码如下:
接口(里面含有大量预处理内容):
#ifndef EXCEPT_INCLUDED
#define EXCEPT_INCLUDED
#include <setjmp.h>
#define T Except_T
typedef struct T
{
char *reason;
} T;
typedef struct Except_Frame Except_Frame;
struct Except_Frame
{
Except_Frame *prev;
jmp_buf env;
const char *file;
int line;
const T *exception;
};
enum
{
Except_entered = 0,
Except_raised,
Except_handled,
Except_finalized
};
#ifdef WIN32
__declspec(thread)
#endif
extern Except_Frame *Except_stack;
extern const Except_T Assert_Failed;
void Except_raise(const T *e, const char *file, int line);
#define RAISE(e) Except_raise( &(e), __FILE__, __LINE__ )
#define RERAISE Except_raise( Except_frame.exception, \
Except_frame.file, Except_frame.line )
#define RETURN \
switch ( Except_stack = Except_stack-> prev, 0 ) \
default: \
return
#define TRY \
do \
{ \
volatile int Except_flag; \
Except_Frame Except_frame; \
代码如下:
接口(里面含有大量预处理内容):
#ifndef EXCEPT_INCLUDED
#define EXCEPT_INCLUDED
#include <setjmp.h>
#define T Except_T
typedef struct T
{
char *reason;
} T;
typedef struct Except_Frame Except_Frame;
struct Except_Frame
{
Except_Frame *prev;
jmp_buf env;
const char *file;
int line;
const T *exception;
};
enum
{
Except_entered = 0,
Except_raised,
Except_handled,
Except_finalized
};
#ifdef WIN32
__declspec(thread)
#endif
extern Except_Frame *Except_stack;
extern const Except_T Assert_Failed;
void Except_raise(const T *e, const char *file, int line);
#define RAISE(e) Except_raise( &(e), __FILE__, __LINE__ )
#define RERAISE Except_raise( Except_frame.exception, \
Except_frame.file, Except_frame.line )
#define RETURN \
switch ( Except_stack = Except_stack-> prev, 0 ) \
default: \
return
#define TRY \
do \
{ \
volatile int Except_flag; \
Except_Frame Except_frame; \