19#ifndef __PJ_EXCEPTION_H__
20#define __PJ_EXCEPTION_H__
28#include <pj/compat/setjmp.h>
265#if defined(PJ_EXCEPTION_USE_WIN32_SEH) && PJ_EXCEPTION_USE_WIN32_SEH != 0
271#define WIN32_LEAN_AND_MEAN
277 RaiseException(
id,1,0,NULL);
280#define PJ_USE_EXCEPTION
282#define PJ_CATCH(id) __except(GetExceptionCode()==id ? \
283 EXCEPTION_EXECUTE_HANDLER : \
284 EXCEPTION_CONTINUE_SEARCH)
285#define PJ_CATCH_ANY __except(EXCEPTION_EXECUTE_HANDLER)
287#define PJ_THROW(id) pj_throw_exception_(id)
288#define PJ_GET_EXCEPTION() GetExceptionCode()
291#elif defined(PJ_SYMBIAN) && PJ_SYMBIAN!=0
309#define PJ_USE_EXCEPTION
312#define PJ_CATCH_ANY catch (const TPjException & pj_excp_)
314#define PJ_THROW(x_id) do { TPjException e; e.code_=x_id; throw e;} \
316#define PJ_GET_EXCEPTION() pj_excp_.code_
320#define PJ_USE_EXCEPTION
322#define PJ_CATCH_ANY if (0)
324#define PJ_THROW(x_id) do { PJ_LOG(1,("PJ_THROW"," error code = %d",x_id)); } while (0)
325#define PJ_GET_EXCEPTION() 0
367#define PJ_USE_EXCEPTION struct pj_exception_state_t pj_x_except__; int pj_x_code__
373#define PJ_TRY if (1) { \
374 pj_push_exception_handler_(&pj_x_except__); \
375 pj_x_code__ = pj_setjmp(pj_x_except__.state); \
376 if (pj_x_code__ == 0)
382#define PJ_CATCH(id) else if (pj_x_code__ == (id))
388#define PJ_CATCH_ANY else
394#define PJ_END pj_pop_exception_handler_(&pj_x_except__); \
402#define PJ_THROW(exception_id) pj_throw_exception_(exception_id)
409#define PJ_GET_EXCEPTION() (pj_x_code__)
void pj_push_exception_handler_(struct pj_exception_state_t *rec)
void pj_throw_exception_(pj_exception_id_t id) PJ_ATTR_NORETURN
void pj_pop_exception_handler_(struct pj_exception_state_t *rec)
int pj_status_t
Definition: types.h:68
int pj_exception_id_t
Definition: types.h:276
const char * pj_exception_id_name(pj_exception_id_t id)
pj_status_t pj_exception_id_alloc(const char *name, pj_exception_id_t *id)
pj_status_t pj_exception_id_free(pj_exception_id_t id)
#define PJ_BEGIN_DECL
Definition: config.h:1284
#define PJ_DECL_NO_RETURN(type)
Definition: config.h:1282
#define PJ_END_DECL
Definition: config.h:1285
#define PJ_IDECL_NO_RETURN(type)
Definition: config.h:1283
struct pj_exception_state_t * prev
Definition: except.h:343
pj_jmp_buf state
Definition: except.h:342
Declaration of basic types and utility.