Adobe.com
Contents Suites Classes Class Index Member Index

AIAssert.hpp

Go to the documentation of this file.
00001 /*************************************************************************
00002 *
00003 * ADOBE CONFIDENTIAL
00004 * 
00005 * Copyright 2018 Adobe
00006 * 
00007 * All Rights Reserved.
00008 *
00009 * NOTICE: Adobe permits you to use, modify, and distribute this file in
00010 * accordance with the terms of the Adobe license agreement accompanying
00011 * it. If you have received this file from a source other than Adobe,
00012 * then your use, modification, or distribution of it requires the prior
00013 * written permission of Adobe.
00014 *
00015 **************************************************************************/
00016 
00017 #pragma once
00018 
00019 #include "./config/AIAssertConfig.h"
00020 
00021 #if     AI_ASSERTS_ENABLED
00022 
00023 #include "AIAssertion.h"
00024 
00025 #if AI_AUTO_SUITE_AVAILABLE
00026         #include "AutoSuite.h"
00027         use_suite_required(AIAssertion)
00028 #elif defined(_AIASSERT_SUITE_INCLUDE_H_)
00029     #include _AIASSERT_SUITE_INCLUDE_H_
00030 #else
00031         extern "C" AIAssertionSuite *sAIAssertion;
00032 #endif // AI_AUTO_SUITE_AVAILABLE
00033 
00034 #endif  // AI_ASSERTS_ENABLED
00035 
00036 #include "AIHeaderBegin.h"
00037 
00038 #if     AI_ASSERTS_ENABLED
00039 namespace ai
00040 {
00041         void ShowPlatformAssert(const bool success, const char* message);
00042 }
00043 #define AIAssert(_success)                                                          \
00044     do                                                                              \
00045     {                                                                                   \
00046                 try                                                                                                                                                     \
00047                 {                                                                                                                                                       \
00048                         if(sAIAssertion)                                                            \
00049                         {                                                                           \
00050                                 sAIAssertion->AssertProc((_success), nullptr, __FILE__, __LINE__);      \
00051                         }                                                                           \
00052                         else                                                                        \
00053                         {                                                                           \
00054                                 ai::ShowPlatformAssert((_success),nullptr);                             \
00055                         }                                                                          \
00056                 } \
00057                 catch(...) {} \
00058     } while (0)                                                                     \
00059         
00060 
00061 
00062 
00063 #define AIMsgAssert(_success, _message)                                             \
00064     do                                                                              \
00065     {                                                                               \
00066                 try \
00067                 { \
00068                         if(sAIAssertion)                                                            \
00069                         {                                                                           \
00070                                 sAIAssertion->AssertProc((_success), (_message), __FILE__, __LINE__);   \
00071                         }                                                                           \
00072                         else                                                                        \
00073                         {                                                                           \
00074                                 ai::ShowPlatformAssert((_success), _message);                                       \
00075                         }                                                                           \
00076                 } \
00077                 catch (...) {} \
00078     } while (0)                                                                     \
00079 
00080 #else
00081 
00082 #define AIAssert(_success)                              \
00083         do                                                                      \
00084         {                                                                       \
00085         } while (0)                                                     \
00086 
00087 #define AIMsgAssert(_success, _message) \
00088         do                                                                      \
00089         {                                                                       \
00090         } while (0)                                                     \
00091 
00092 #endif  // AI_ASSERTS_ENABLED
00093 
00094 #include "AIHeaderEnd.h"


Contents Suites Classes Class Index Member Index
Adobe Solutions Network
 
Copyright © 2014 Adobe Systems Incorporated. All rights reserved.
Terms of Use Online Privacy Policy Adobe and accessibility Avoid software piracy Permissions and Trademarks