⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 debuglog.h

📁 用UDP写的可靠传输程序源代码,非常有借鉴意义,适合互连网通讯
💻 H
字号:
// Macrodefinitions for building debug logs
// Declaration file
//
// (c) Lev Naumov, CAMEL Laboratory
// E-mail: camellab@mail.ru
// For more information see http://camel.ifmo.ru or
// http://www.codeproject.com/internet/ctp.asp
/////////////////////////////////////////////////////////////////////////////

//#define DEBUG_LOG

// Deadlocks logging

#ifdef DEBUG_LOG

#define LOCK(x) TRACE2("1: Try lock   at %s (%d)\n",__FILE__,__LINE__); x.Lock(); TRACE2("2: Locked     at %s (%d)\n",__FILE__,__LINE__);
#define UNLOCK(x) TRACE2("3: Try unlock at %s (%d)\n",__FILE__,__LINE__); x.Unlock(); TRACE2("4: Unlocked   at %s (%d)\n",__FILE__,__LINE__);

#else

#define LOCK(x) x.Lock()
#define UNLOCK(x) x.Unlock()

#endif

// Checks if pointer p is valid or not

#ifdef _DEBUG

#define VALID(p) (p || (unsigned int)p==0xcdcdcdcd)

#else

#define VALID(p) (p)

#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -