Files
EgtExecutor/EXE_Macro.h
T
DarioS e2b0a333da EgtExecutor 2.3h1 :
- la versione x64 compilata con clang-cl
- migliorie e correzioni suggerite dal nuovo compilatore.
2021-08-01 10:54:29 +02:00

72 lines
3.5 KiB
C++

//----------------------------------------------------------------------------
// EgalTech 2014-2020
//----------------------------------------------------------------------------
// File : EXE_Macro Data : 02.09.20 Versione : 2.2i1
// Contenuto : Macro locali per moduli EXE.
//
//
//
// Modifiche : 03.09.14 DS Creazione modulo.
//
//
//----------------------------------------------------------------------------
#pragma once
//-----------------------------------------------------------------------------
#ifdef __clang__
#define VERIFY_NULL( pO, Msg, Ret) if ( pO == nullptr) { \
LOG_ERROR( GetLogger(), ( std::string( Msg) + " (" + __func__ + ")").c_str()) \
return Ret ; \
}
#else
#define VERIFY_NULL( pO, Msg, Ret) if ( pO == nullptr) { \
LOG_ERROR( GetLogger(), Msg " (" __FUNCTION__ ")") \
return Ret ; \
}
#endif
//-----------------------------------------------------------------------------
#ifdef __clang__
#define VERIFY_2NULL( pO, pQ, Msg, Ret) if ( pO == nullptr || pQ == nullptr) { \
LOG_ERROR( GetLogger(), ( std::string( Msg) + " (" + __func__ + ")").c_str()) \
return Ret ; \
}
#else
#define VERIFY_2NULL( pO, pQ, Msg, Ret) if ( pO == nullptr || pQ == nullptr) { \
LOG_ERROR( GetLogger(), Msg " (" __FUNCTION__ ")") \
return Ret ; \
}
#endif
//-----------------------------------------------------------------------------
#define VERIFY_CTX( pC, Ret) VERIFY_NULL( pC, "Context invalid", Ret)
//-----------------------------------------------------------------------------
#define VERIFY_GEOMDB( pG, Ret) VERIFY_NULL( pG, "GeomDB invalid", Ret)
//-----------------------------------------------------------------------------
#define VERIFY_CTX_GEOMDB( pC, Ret) VERIFY_2NULL( pC, pC->m_pGeomDB, "Context or GeomDB invalid", Ret)
//-----------------------------------------------------------------------------
#define VERIFY_MACHMGR( pM, Ret) VERIFY_NULL( pM, "MachMgr invalid", Ret)
//-----------------------------------------------------------------------------
#define VERIFY_CTX_MACHMGR( pC, Ret) VERIFY_2NULL( pC, pC->m_pMachMgr, "Context or MachMgr invalid", Ret)
//-----------------------------------------------------------------------------
#define VERIFY_SCENE( pS, Ret) VERIFY_NULL( pS, "Scene invalid", Ret)
//-----------------------------------------------------------------------------
#define VERIFY_CTX_SCENE( pC, Ret) VERIFY_2NULL( pC, pC->m_pScene, "Context or Scene invalid", Ret)
//-----------------------------------------------------------------------------
#define VERIFY_TSCEXEC( pT, Ret) VERIFY_NULL( pT, "TscExecutor invalid", Ret)
//-----------------------------------------------------------------------------
#define VERIFY_BEAMMGR( pM, Ret) VERIFY_NULL( pM, "BeamMgr invalid", Ret)
//-----------------------------------------------------------------------------
#define VERIFY_CTX_BEAMMGR( pC, Ret) VERIFY_2NULL( pC, pC->m_pBeamMgr, "Context or BeamMgr invalid", Ret)