Quantum Fog  0.9.3
ANSI_UException.h
1 //Mac CodeWarrior PowerPlant users can replace this by UException.h
2 //to increase functionality.
3 #pragma once
4 
5 #include "ANSI_UDebugging.h"
6 
7 typedef long ExceptionCode;
8 
9 enum {
10  err_NilPointer = 'nilP',
11  err_AssertFailed = 'asrt'
12 };
13 
14 #define ThrowIfNil_(ptr) \
15  do { \
16  if ((ptr) == 0) Throw_(err_NilPointer); \
17  } while (false)
18 
19 #define ThrowIf_(test) \
20  do { \
21  if (test) Throw_(err_AssertFailed); \
22  } while (false)