/*////////////////////*/
/* macro for Memory //*/
/*////////////////////*/
#ifndef _MacroGLD_
#define _MacroGLD_
 
#define _szPersonalMsg_ "V5.9.0 - August 11th 1997"
 
#define M_GLDInitMmg() Mmg_M_SetModeAlloc4Ch(GLD, E_ucDynamic,C_ucMmgDefaultChannel)
 
/*
#define M_GLDAlloc( Var, cast, ulSize, error )\
{\
	M_GLDInitMmg();\
	Var = (cast)Mmg_fn_p_vAlloc(ulSize);\
	if ( Erm_M_uwCheckError( Mmg, C_ucErmDefaultChannel ) )\
    {\
        Var = NULL;\
		Erm_M_ClearLastError( C_ucErmDefaultChannel );\
		Erm_M_UpdateLastError( GLD, C_ucErmDefaultChannel, (error), C_lErmNoDebugData, C_ucErmOpenInfoWindow, C_ucAllowStopForDebug, _szPersonalMsg_ );\
	}\
}
*/
 
#define M_GLDAlloc( Var, cast, ulSize, error )\
{\
	M_GLDInitMmg();\
	Var = (cast)Mmg_fn_p_vAlloc(ulSize);\
}
 
 
/*#define M_GLDFree( p_cAdr ) \
{\
	M_GLDInitMmg();\
	Mmg_fn_vFree( p_cAdr );\
	if ( Erm_M_uwCheckError( Mmg, C_ucErmDefaultChannel ) )\
    {\
		Erm_M_ClearLastError( C_ucErmDefaultChannel );\
		Erm_M_UpdateLastError( GLD, C_ucErmDefaultChannel, E_uwGLDWarningCanNotFree, C_lErmNoDebugData, C_ucErmOpenInfoWindow, C_ucAllowStopForDebug, _szPersonalMsg_ );\
	}\
}
*/
 
#define M_GLDFree( p_cAdr ) \
{\
	M_GLDInitMmg();\
	Mmg_fn_vFree( p_cAdr );\
}
 
typedef float GLD_tdxValue ;
#define GLD_M_LongToValue(A)    ( (GLD_tdxValue) ( A ) )
 
#define GLD_M_Mul(A,B)          (GLD_tdxValue)( ( A ) * ( B ) )
#define GLD_M_Sub(A,B)          (GLD_tdxValue)( ( A ) - ( B ) )
#define GLD_M_Add(A,B)          (GLD_tdxValue)( ( A ) + ( B ) )
#define GLD_M_Div(A,B)          (GLD_tdxValue)( ( A ) / ( B ) )
#define GLD_M_Neg(A)            ( -( A ) )
 
#endif /* __GLDMACROS_H__*/
 
 
 
