1 // Conditions (a.k.a. exceptions)
3 #ifndef _CL_CONDITION_H
4 #define _CL_CONDITION_H
11 void* operator new (size_t size) { return cl_malloc_hook(size); }
13 void operator delete (void* ptr) { cl_free_hook(ptr); }
15 virtual const char * name () const = 0;
17 virtual void print (cl_ostream) const = 0;
18 // Virtual destructor.
19 virtual ~cl_condition ()
20 #if defined(__GNUC__) && (__GNUC__ == 2) && (__GNUC_MINOR__ < 8) // workaround gcc bug
26 virtual void dummy ();
28 #define SUBCLASS_cl_condition() \
31 void* operator new (size_t size) { return cl_malloc_hook(size); } \
33 void operator delete (void* ptr) { cl_free_hook(ptr); }
35 // Functions which want to raise a condition return a `cl_condition*'.
36 // The caller checks this value. NULL means no condition. The one who
37 // disposes the condition (handles it without resignalling it) should
38 // call `delete' on the condition pointer.
40 #endif /* _CL_CONDITION_H */