// Port of pflib/external/openal/CAException.h (Apple Core Audio utility class, Playground SDK 4.0): the exception // type that carries an OSStatus error code. Header-only in both builds: the constructor and the empty, non-virtual // destructor are inline, so the class has no vtable; it is just mError (size 4). // // Game code: the game keeps one out-of-line copy of the (inline) destructor, game @0x001926c4 (D1, empty); the // constructor is inlined at every throw site (a throw site allocates the exception, stores the error and throws // with this destructor as the cleanup). sdk @0x18c4 (constructor) / @0x18d4 (destructor) in // parity-out/sdk/dbgobj/CAMutex.o and sdk @0x1e38 / @0x1e48 in CAGuard.o. // // CATry / CACatch / CASwallowException are kept as declared (the ported code does not use them so far). #ifndef CAEXCEPTION_H_INCLUDED #define CAEXCEPTION_H_INCLUDED #include class CAException { public: CAException(OSStatus inError) : mError(inError) {} CAException(const CAException& inException) : mError(inException.mError) {} CAException& operator=(const CAException& inException) { mError = inException.mError; return *this; } ~CAException() {} OSStatus GetError() const { return mError; } protected: OSStatus mError; }; #define CATry try{ #define CACatch }catch(const CAException& inException) {} catch(...) {} #define CASwallowException(inExpression) try { inExpression; } catch(...) {} #endif