/*---------------------------------------------------------------------------* Project: Horizon File: err_Api.h Copyright (C)2010 Nintendo Co., Ltd. All rights reserved. These coded instructions, statements, and computer programs contain proprietary information of Nintendo of America Inc. and/or Nintendo Company Ltd., and are protected by Federal copyright law. They may not be disclosed to third parties or copied or duplicated in any form, in whole or in part, without the prior written consent of Nintendo. $Rev: 31762 $ *--------------------------------------------------------------------------- */ #ifndef NN_ERR_CTR_ERR_API_H_ #define NN_ERR_CTR_ERR_API_H_ #include #include #ifdef __cplusplus namespace nn { namespace err { namespace CTR { void ThrowFatalErr( Result result ); }}} // namespace nn::err::CTR #ifndef NN_HARDWARE_CTR_LEGACY #ifdef NN_PROCESSOR_ARM11MPCORE /* Throws a fatal error for the error display applet. Notification occurs only if the Result LEVEL is FATAL. */ #define NN_ERR_THROW_FATAL_IF_FATAL_ONLY(result) \ do \ { \ ::nn::Result resultLocal = (result); \ if ( resultLocal.GetLevel() == ::nn::Result::LEVEL_FATAL ) \ { \ ::nn::err::ThrowFatalErr(resultLocal); \ } \ } while(0) /* Throws a fatal error for the error display applet. Notification is sent when the Result LEVEL is not SUCCESS, STATUS, or INFO (not recommended) - this indicates a fatal error or error that cannot occur in retail product. */ #define NN_ERR_THROW_FATAL(result) \ do \ { \ ::nn::Result resultLocal = (result); \ switch ( resultLocal.GetLevel() ) \ { \ case ::nn::Result::LEVEL_INFO: \ case ::nn::Result::LEVEL_SUCCESS: \ case ::nn::Result::LEVEL_STATUS: \ break; \ default: \ ::nn::err::ThrowFatalErr(resultLocal); \ } \ } while(0) /* Throws a fatal error for the error display applet. Sends notification for all error results. */ #define NN_ERR_THROW_FATAL_ALL(result) \ do \ { \ ::nn::Result resultLocal = (result); \ if ( resultLocal.IsFailure() ) \ { \ ::nn::err::ThrowFatalErr(resultLocal); \ } \ } while(0) #else /* NN_PROCESSOR_ARM11MPCORE */ #define NN_ERR_THROW_FATAL_IF_FATAL_ONLY(result) NN_UTIL_PANIC_IF_FAILED(result) #define NN_ERR_THROW_FATAL(result) NN_UTIL_PANIC_IF_FAILED(result) #define NN_ERR_THROW_FATAL_ALL(result) NN_UTIL_PANIC_IF_FAILED(result) #endif /* NN_PROCESSOR_ARM11MPCORE */ #else /* NN_HARDWARE_CTR_LEGACY */ #define NN_ERR_THROW_FATAL_IF_FATAL_ONLY(result) \ do \ { \ ::nn::Result resultLocal = (result); \ NN_UNUSED_VAR(resultLocal); \ } while(0) #define NN_ERR_THROW_FATAL(result) \ do \ { \ ::nn::Result resultLocal = (result); \ NN_UNUSED_VAR(resultLocal); \ } while(0) #define NN_ERR_THROW_FATAL_ALL(result) \ do \ { \ ::nn::Result resultLocal = (result); \ NN_UNUSED_VAR(resultLocal); \ } while(0) #endif /* NN_HARDWARE_CTR_LEGACY */ #endif // __cplusplus #endif /* NN_ERR_CTR_ERR_API_H_ */