hikyuu2/hikyuu_cpp/hikyuu/debug.h

32 lines
785 B
C++
Raw Normal View History

2020-03-01 01:24:55 +08:00
/*
* Copytright (C) hikyuu.org
*
* Created on: 2020-2-6
* Author: fasiondog
*
* cpp 便
*/
#pragma once
#if defined(_MSC_VER) && (defined(_DEBUG) || defined(DEBUG))
#ifndef MSVC_LEAKER_DETECT
#define MSVC_LEAKER_DETECT
#endif
#endif
// clang-format off
// MSVC 内存泄露检测
#ifdef MSVC_LEAKER_DETECT
#define _CRTDBG_MAP_ALLOC
#include "crtdbg.h"
#ifndef DEBUG_CLIENTBLOCK
#define DEBUG_CLIENTBLOCK new (_CLIENT_BLOCK, __FILE__, __LINE__)
#define new DEBUG_CLIENTBLOCK
#endif /* #ifndef DEBUG_CLIENTBLOCK */
#else /* #if MSVC_LEAKER_DETECT */
#define DEBUG_CLIENTBLOCK
#endif /* #if MSVC_LEAKER_DETECT */
// clang-format on