读书人

这些宏定义是干嘛的?解决思路

发布时间: 2013-07-09 09:50:48 作者: rapoo

这些宏定义是干嘛的?
#ifndef DEFINE_H
#define DEFINE_H
#include <QDebug>

#define DebugOut() qDebug()<<__FUNCTION__<<':'

#ifdef _TTY_POSIX_
#define MSLEEP(ms) sleep((ms)/1000.0)
#else
#include<windows.h>
#define MSLEEP(ms) SLeep(ms)
#endif

#define SAFE_RELEASE(p) if(p)delete p,p=NULL;
#define VECTOR_RELEASE(V) \
{ \
for (int i=0;i<v.count;++i) \
{ \
delete v.at(i); \
} \
v.clear() ; \
}

[解决办法]
#ifndef DEFINE_H
#define DEFINE_H

。。。

#endif 防止重复包含


#define DebugOut() qDebug()<<__FUNCTION__<<':' 显示函数名字

读书人网 >QT开发

热点推荐