18#ifndef _WIZARDSTOOLKIT_EXCEPTION_PRIVATE_H
19#define _WIZARDSTOOLKIT_EXCEPTION_PRIVATE_H
25#if defined(__cplusplus) || defined(c_plusplus)
29#define CatchWizardException(severity,tag,context) \
34 exception=AcquireExceptionInfo(); \
35 (void) ThrowWizardException(exception,GetWizardModule(),severity,tag,context); \
36 CatchException(exception); \
37 exception=DestroyExceptionInfo(exception); \
40#if defined(WIZARDSTOOLKIT_Debug)
41#define WizardAssert(domain,predicate) \
46#define WizardAssert(domain,predicate) \
48 if ((WizardBooleanType) (predicate) == WizardFalse) \
49 ThrowWizardFatalError(domain,AssertError); \
53#define ThrowFileException(exception,severity,context) \
58 message=GetExceptionMessage(errno); \
59 (void) ThrowWizardException(exception,GetWizardModule(),severity, \
60 "file exception `%s': %s",context,message); \
61 message=DestroyString(message); \
64#define ThrowWizardFatalError(domain,error) \
67 context[WizardPathExtent], \
68 tag[WizardPathExtent]; \
70 (void) FormatLocaleString(tag,WizardPathExtent,"%ld\n",(long) domain); \
71 (void) FormatLocaleString(context,WizardPathExtent,"%ld\n",(long) error); \
72 CatchWizardException(UndefinedException,tag,context); \
73 WizardsToolkitTerminus(); \
74 _exit((domain << 3) | error); \
77#define ThrowFatalException(severity,tag) \
82 message=GetExceptionMessage(errno); \
83 CatchWizardException(severity,tag,message); \
84 message=DestroyString(message); \
85 WizardsToolkitTerminus(); \
89#if defined(__cplusplus) || defined(c_plusplus)