/*
?XCode?LLVM?XXX?-?Preprocessing中Debug会添加?DEBUG=1?标志
?*/
#ifdef?DEBUG
#define?NSLog(FORMAT,?...)?fprintf(stderr,"%s:%d\t%s\n",[[[NSString?stringWithUTF8String:__FILE__]?lastP...
分类:
移动开发 时间:
2014-07-21 10:34:03
阅读次数:
244
lib/pathalloc.c#include "apue.h"#include #include #ifdef PATH_MAXstatic int pathmax = PATH_MAX;#elsestatic int pathmax = 0;#endif#define SUSV3 200112L...
分类:
其他好文 时间:
2014-07-19 19:34:54
阅读次数:
280
之前使用vld检测内存泄露,有兴趣可以一观:http://blog.csdn.net/alex_my/article/details/11488805控制台下,MFC未测试。使用方法如下:#include ifdef _DEBUGdefine new new(_NORMAL_BLOCK, __FIL...
lib/openmax.c#include "apue.h"#include #include #ifdef OPEN_MAXstatic long openmax = OPEN_MAX;#elsestatic long openmax = 0;#endif/* * If OPEN_MAX is i...
分类:
其他好文 时间:
2014-07-18 23:36:31
阅读次数:
279
开发时,经常用到NSLog,但release是又想一次过清掉all NSLog,方法是:在xxx-Prefix.pch里添加[cpp]view plaincopy#ifdefDEBUG#defineDLog(...)NSLog(__VA_ARGS__)#else#defineDLog(...)/**...
分类:
移动开发 时间:
2014-07-18 21:05:57
阅读次数:
221
这是很经典的想法了,但是如何来做,不经过摸索不知道细节。最简单:dll处#include"stdafx.h"#ifdef_DEBUG#definenewDEBUG_NEW#endif#defineDllExport_declspec(dllexport)DllExportdoubleaValue =...
分类:
其他好文 时间:
2014-07-16 18:11:18
阅读次数:
174
一、非MFC程序可以用以下方法检测内存泄露:1. 程序开始包含如下定义:#ifdef _DEBUG#define DEBUG_CLIENTBLOCK new( _CLIENT_BLOCK, __FILE__, __LINE__)#else#define DEBUG_CLIENTBLOCK#endif...
分类:
其他好文 时间:
2014-07-16 15:08:37
阅读次数:
295
如下一段代码可以借鉴:static void _sleep_response_timeout(modbus_t *ctx)
{
#ifdef _WIN32
/* usleep doesn't exist on Windows */
Sleep((ctx->response_timeout.tv_sec * 1000) +
(ctx->response_timeo...
分类:
系统相关 时间:
2014-07-10 20:42:13
阅读次数:
303
mtk套接字所有的声明放在soc_api.h条件编译命令最常见的形式为:?12345#ifdef标识符 //程序段1 #else //程序段2 #endif它的作用是:当标识符已经被定义过(一般是用#define命令定义),则对程序段1进行编译,否则编译程序段2。
分类:
其他好文 时间:
2014-07-09 16:37:40
阅读次数:
233
条件编译(#ifdef #else #endif #if)...
分类:
其他好文 时间:
2014-07-02 09:15:09
阅读次数:
329