#if defined(DEBUG) && !defined(DISABLE_YDTRIGGER)
#ifndef OPEN_LEAK_MONITOR_MACRO

//====================================================================================
//  location
//====================================================================================
#define GetStartLocationLoc(a)              YDML_Newlocation(GetStartLocationLoc(a))
#define Location(a,b)                       YDML_Newlocation(Location(a,b))
#define GetOrderPointLoc()                  YDML_Newlocation(GetOrderPointLoc())
#define GetSpellTargetLoc()                 YDML_Newlocation(GetSpellTargetLoc())
#define GetUnitLoc(a)                       YDML_Newlocation(GetUnitLoc(a))
#define GetUnitRallyPoint(a)                YDML_Newlocation(GetUnitRallyPoint(a))
#define CameraSetupGetDestPositionLoc(a)    YDML_Newlocation(CameraSetupGetDestPositionLoc(a))
#define GetCameraTargetPositionLoc(a)       YDML_Newlocation(GetCameraTargetPositionLoc(a))
#define GetCameraEyePositionLoc(a)          YDML_Newlocation(GetCameraEyePositionLoc(a))

#define PolarProjectionBJ(a,b,c)            YDML_Newlocation(PolarProjectionBJ(a,b,c))
#define GetRandomLocInRect(a)               YDML_Newlocation(GetRandomLocInRect(a))
#define OffsetLocation(a,b,c)               YDML_Newlocation(OffsetLocation(a,b,c))
#define GetItemLoc(a)                       YDML_Newlocation(GetItemLoc(a))
#define GetDestructableLoc(a)               YDML_Newlocation(GetDestructableLoc(a))
#define WaygateGetDestinationLocBJ(a)       YDML_Newlocation(WaygateGetDestinationLocBJ(a))
#define GetPlayerStartLocationLoc(a)        YDML_Newlocation(GetPlayerStartLocationLoc(a))
#define GetRectCenter(a)                    YDML_Newlocation(GetRectCenter(a))
#define MeleeGetProjectedLoc(a,b,c,d)       YDML_Newlocation(MeleeGetProjectedLoc(a,b,c,d))
#define MeleeGetLocWithinRect(a,b)          YDML_Newlocation(MeleeGetLocWithinRect(a,b))

#define RemoveLocation(h)                   RemoveLocation(YDML_Deletelocation(h))
//====================================================================================
//  group
//====================================================================================
#define CreateGroup()                       YDML_Newgroup(CreateGroup())

#ifdef USE_BJ_ANTI_LEAK

#ifdef GetUnitsInRectMatching
#undef GetUnitsInRectMatching
#endif

#ifdef GetUnitsInRectAll
#undef GetUnitsInRectAll
#endif

#ifdef GetUnitsInRectOfPlayer
#undef GetUnitsInRectOfPlayer
#endif

#ifdef GetUnitsInRangeOfLocMatching
#undef GetUnitsInRangeOfLocMatching
#endif

#ifdef GetUnitsInRangeOfLocAll
#undef GetUnitsInRangeOfLocAll
#endif

#ifdef GetUnitsOfTypeIdAll
#undef GetUnitsOfTypeIdAll
#endif

#ifdef GetUnitsOfPlayerMatching
#undef GetUnitsOfPlayerMatching
#endif

#ifdef GetUnitsOfPlayerAndTypeId
#undef GetUnitsOfPlayerAndTypeId
#endif

#ifdef GetUnitsSelectedAll
#undef GetUnitsSelectedAll
#endif

#ifdef GetRandomSubGroup
#undef GetRandomSubGroup
#endif


#define GetUnitsInRectMatching(a,b)         YDML_Newgroup(YDWEGetUnitsInRectMatchingNull(a,b))
#define GetUnitsInRectAll(a)                YDML_Newgroup(YDWEGetUnitsInRectAllNull(a))
#define GetUnitsInRectOfPlayer(a,b)         YDML_Newgroup(YDWEGetUnitsInRectOfPlayerNull(a,b))
#define GetUnitsInRangeOfLocMatching(a,b,c) YDML_Newgroup(YDWEGetUnitsInRangeOfLocMatchingNull(a,b,c))
#define GetUnitsInRangeOfLocAll(a,b)        YDML_Newgroup(YDWEGetUnitsInRangeOfLocAllNull(a,b))
#define GetUnitsOfTypeIdAll(a)              YDML_Newgroup(YDWEGetUnitsOfTypeIdAllNull(a))
#define GetUnitsOfPlayerMatching(a,b)       YDML_Newgroup(YDWEGetUnitsOfPlayerMatchingNull(a,b))
#define GetUnitsOfPlayerAndTypeId(a,b)      YDML_Newgroup(YDWEGetUnitsOfPlayerAndTypeIdNull(a,b))
#define GetUnitsSelectedAll(a)              YDML_Newgroup(YDWEGetUnitsSelectedAllNull(a))
#define GetRandomSubGroup(a,b)              YDML_Newgroup(YDWEGetRandomSubGroupNull(a,b))

#else

#define GetUnitsInRectMatching(a,b)         YDML_Newgroup(GetUnitsInRectMatching(a,b))
#define GetUnitsInRectAll(a)                YDML_Newgroup(GetUnitsInRectAll(a))
#define GetUnitsInRectOfPlayer(a,b)         YDML_Newgroup(GetUnitsInRectOfPlayer(a,b))
#define GetUnitsInRangeOfLocMatching(a,b,c) YDML_Newgroup(GetUnitsInRangeOfLocMatching(a,b,c))
#define GetUnitsInRangeOfLocAll(a,b)        YDML_Newgroup(GetUnitsInRangeOfLocAll(a,b))
#define GetUnitsOfTypeIdAll(a)              YDML_Newgroup(GetUnitsOfTypeIdAll(a))
#define GetUnitsOfPlayerMatching(a,b)       YDML_Newgroup(GetUnitsOfPlayerMatching(a,b))
#define GetUnitsOfPlayerAndTypeId(a,b)      YDML_Newgroup(GetUnitsOfPlayerAndTypeId(a,b))
#define GetUnitsSelectedAll(a)              YDML_Newgroup(GetUnitsSelectedAll(a))
#define GetRandomSubGroup(a,b)              YDML_Newgroup(GetRandomSubGroup(a,b))

#endif

//bj_wantDestroyGroup
#define IsUnitGroupDeadBJ(a)                IsUnitGroupDeadBJ(YDML_DeletegroupEx(a))
#define IsUnitGroupEmptyBJ(a)               IsUnitGroupEmptyBJ(YDML_DeletegroupEx(a))
#define GroupAddGroup(a,b)                  GroupAddGroup(YDML_DeletegroupEx(a),b)
#define GroupRemoveGroup(a,b)               GroupRemoveGroup(YDML_DeletegroupEx(a),b)
#define GroupPickRandomUnit(a)              GroupPickRandomUnit(YDML_DeletegroupEx(a))
#define CountUnitsInGroup(a)                CountUnitsInGroup(YDML_DeletegroupEx(a))

#define DestroyGroup(h)                     DestroyGroup(YDML_Deletegroup(h))
//====================================================================================
//  effect
//====================================================================================
#define AddSpecialEffect(a,b,c)             YDML_Neweffect(AddSpecialEffect(a,b,c))
#define AddSpecialEffectLoc(a,b)            YDML_Neweffect(AddSpecialEffectLoc(a,b))
#define AddSpecialEffectTarget(a,b,c)       YDML_Neweffect(AddSpecialEffectTarget(a,b,c))
#define AddSpellEffect(a,b,c,d)             YDML_Neweffect(AddSpellEffect(a,b,c,d))
#define AddSpellEffectLoc(a,b,c)            YDML_Neweffect(AddSpellEffectLoc(a,b,c))
#define AddSpellEffectById(a,b,c,d)         YDML_Neweffect(AddSpellEffectById(a,b,c,d))
#define AddSpellEffectByIdLoc(a,b,c)        YDML_Neweffect(AddSpellEffectByIdLoc(a,b,c))
#define AddSpellEffectTarget(a,b,c,d)       YDML_Neweffect(AddSpellEffectTarget(a,b,c,d))
#define AddSpellEffectTargetById(a,b,c,d)   YDML_Neweffect(AddSpellEffectTargetById(a,b,c,d))

#define AddSpecialEffectLocBJ(a,b)          YDML_Neweffect(AddSpecialEffectLocBJ(a,b))
#define AddSpecialEffectTargetUnitBJ(a,b,c) YDML_Neweffect(AddSpecialEffectTargetUnitBJ(a,b,c))

#define DestroyEffect(h)                    DestroyEffect(YDML_Deleteeffect(h))
#define DestroyEffectBJ(h)                  DestroyEffectBJ(YDML_Deleteeffect(h))
//====================================================================================
#define OPEN_LEAK_MONITOR_MACRO
#else

//====================================================================================
//  location
//====================================================================================
#undef GetStartLocationLoc
#undef Location
#undef GetOrderPointLoc
#undef GetSpellTargetLoc
#undef GetUnitLoc
#undef GetUnitRallyPoint
#undef CameraSetupGetDestPositionLoc
#undef GetCameraTargetPositionLoc
#undef GetCameraEyePositionLoc

#undef PolarProjectionBJ
#undef GetRandomLocInRect
#undef OffsetLocation
#undef GetItemLoc
#undef GetDestructableLoc
#undef WaygateGetDestinationLocBJ
#undef GetPlayerStartLocationLoc
#undef GetRectCenter
#undef MeleeGetProjectedLoc
#undef MeleeGetLocWithinRect

#undef RemoveLocation
//====================================================================================
//  group
//====================================================================================
#undef CreateGroup

#undef GetUnitsInRectMatching
#undef GetUnitsInRectAll
#undef GetUnitsInRectOfPlayer
#undef GetUnitsInRangeOfLocMatching
#undef GetUnitsInRangeOfLocAll
#undef GetUnitsOfTypeIdAll
#undef GetUnitsOfPlayerMatching
#undef GetUnitsOfPlayerAndTypeId
#undef GetUnitsSelectedAll
#undef GetRandomSubGroup

//bj_wantDestroyGroup
#undef IsUnitGroupDeadBJ
#undef IsUnitGroupEmptyBJ
#undef GroupAddGroup
#undef GroupRemoveGroup
#undef GroupPickRandomUnit
#undef CountUnitsInGroup

#undef DestroyGroup
//====================================================================================
//  effect
//====================================================================================
#undef AddSpecialEffect
#undef AddSpecialEffectLoc
#undef AddSpecialEffectTarget
#undef AddSpellEffect
#undef AddSpellEffectLoc
#undef AddSpellEffectById
#undef AddSpellEffectByIdLoc
#undef AddSpellEffectTarget
#undef AddSpellEffectTargetById

#undef AddSpecialEffectLocBJ
#undef AddSpecialEffectTargetUnitBJ

#undef DestroyEffect
#undef DestroyEffectBJ
//====================================================================================
#undef OPEN_LEAK_MONITOR_MACRO
#endif

#endif
