1 /*---------------------------------------------------------------------------* 2 Project: Horizon 3 File: dbg_PrintResult.h 4 5 Copyright (C)2009-2012 Nintendo Co., Ltd. All rights reserved. 6 7 These coded instructions, statements, and computer programs contain 8 proprietary information of Nintendo of America Inc. and/or Nintendo 9 Company Ltd., and are protected by Federal copyright law. They may 10 not be disclosed to third parties or copied or duplicated in any form, 11 in whole or in part, without the prior written consent of Nintendo. 12 13 $Rev: 46347 $ 14 *---------------------------------------------------------------------------*/ 15 16 /* Please see man pages for details 17 18 19 20 */ 21 22 #ifndef NN_DBG_DBG_PRINTRESULT_H_ 23 #define NN_DBG_DBG_PRINTRESULT_H_ 24 25 #include <nn/Result.h> 26 #include <nn/assert.h> 27 28 #ifdef __cplusplus 29 30 31 // 32 // 33 34 35 /* ======================================================================= 36 Dummy for reference use 37 ======================================================================== */ 38 39 // 40 // 41 42 //--------------------------------------------------------------------------- 43 // 44 // 45 // 46 // 47 // 48 // 49 // 50 // 51 // 52 // 53 // 54 // 55 // 56 // 57 // 58 // 59 //--------------------------------------------------------------------------- 60 #define NN_DBG_CHECK_RESULT(exp) 61 62 //--------------------------------------------------------------------------- 63 // 64 // 65 // 66 // 67 // 68 // 69 //--------------------------------------------------------------------------- 70 #define NN_DBG_PRINT_RESULT(exp) 71 72 // 73 74 // 75 76 #undef NN_DBG_CHECK_RESULT 77 #undef NN_DBG_PRINT_RESULT 78 79 80 81 82 /* ======================================================================= 83 Definition entity 84 ======================================================================== */ 85 86 #ifndef NN_BUILD_DOCUMENT 87 namespace nn { namespace dbg { namespace detail { 88 89 void PrintResult(Result result); 90 const char* GetLevelString(nn::Result result); 91 const char* GetModuleString(nn::Result result); 92 const char* GetSummaryString(nn::Result result); 93 const char* GetDescriptionString(nn::Result result); 94 95 }}} 96 97 #ifndef NN_SWITCH_DISABLE_ASSERT_WARNING 98 #define NN_DBG_DECLARE_GET_RESULT_DESCRIPTION_STRING_IMPL_KEEPER(libname) \ 99 namespace nn { namespace libname { namespace detail { \ 100 void GetResultDescriptionStringImplKeeper(); \ 101 }}} 102 #define NN_DBG_DECLARE_ADDITIONAL_GET_RESULT_DESCRIPTION_STRING_IMPL_KEEPER(libname, option) \ 103 namespace nn { namespace libname { namespace detail { \ 104 void GetResult##option##DescriptionStringImplKeeper(); \ 105 }}} 106 #define NN_DBG_USE_GET_RESULT_DESCRIPTION_STRING_IMPL_KEEPER(libname) \ 107 (::nn::libname::detail::GetResultDescriptionStringImplKeeper()) 108 #define NN_DBG_USE_ADDITIONAL_GET_RESULT_DESCRIPTION_STRING_IMPL_KEEPER(libname, option) \ 109 (::nn::libname::detail::GetResult##option##DescriptionStringImplKeeper()) 110 #else 111 #define NN_DBG_DECLARE_GET_RESULT_DESCRIPTION_STRING_IMPL_KEEPER(libname) 112 #define NN_DBG_DECLARE_ADDITIONAL_GET_RESULT_DESCRIPTION_STRING_IMPL_KEEPER(libname, option) 113 #define NN_DBG_USE_GET_RESULT_DESCRIPTION_STRING_IMPL_KEEPER(libname) (void)0 114 #define NN_DBG_USE_ADDITIONAL_GET_RESULT_DESCRIPTION_STRING_IMPL_KEEPER(libname, option) (void)0 115 #endif 116 117 #ifndef NN_SWITCH_DISABLE_ASSERT_WARNING 118 #define NN_DBG_CHECK_RESULT(exp) NN_PANIC_IF_FAILED(exp) 119 #else 120 #define NN_DBG_CHECK_RESULT(exp) ((void)(exp)) 121 #endif 122 123 #ifndef NN_SWITCH_DISABLE_DEBUG_PRINT 124 #define NN_DBG_PRINT_RESULT(exp) ::nn::dbg::detail::PrintResult(exp) 125 #else 126 #define NN_DBG_PRINT_RESULT(exp) ((void)(exp)) 127 #endif 128 129 #define NN_DBG_TPRINT_RESULT_(exp) NN_DBG_PRINT_RESULT(exp) 130 #endif 131 132 #endif // ifdef __cplusplus 133 134 #endif /* NN_DBG_DBG_RESULT_H_ */ 135