#ifndef _HIK_EVENT_H_ #define _HIK_EVENT_H_ #ifdef _MSC_VER #include #define hik_event_handle HANDLE #else #include typedef struct { bool state; bool ... ...
在Debug模式下中断, 在Release模式下跳出当前函数的断言 #ifdef DEBUG #define __breakPoint_on_debug asm("int3") #else #define __breakPoint_on_debug #endif // 验证 #define UXY_ ...
分类:
其他好文 时间:
2017-08-12 12:37:15
阅读次数:
123
#define __EXPORTS 1 #ifdef __cplusplus #ifdef __EXPORTS #define DLL_EXPORT extern "C" __declspec (dllexport) #else #define DLL_EXPORT extern "C" __dec... ...
分类:
其他好文 时间:
2017-08-10 18:10:18
阅读次数:
149
预处理指令在编译之前,由编译器执行,预处理结果作为编译器的输入。主要功能:把其他文件包含到当前文件、定义符号常量和宏、程序代码的条件编译以及预处理指令的条件执行。预处理指令包括:#include, #define, #error, #if, #else, #elif, #endif, #ifdef,... ...
分类:
其他好文 时间:
2017-08-09 16:51:58
阅读次数:
109
因为静态库是不须要导出的。所以在写QT的前置声明的时候须要说明 #if defined(QT_SHARED) #ifdef COMMONLIB #define COMMONLIB_EXPORT Q_DECL_EXPORT #else #define COMMONLIB_EXPORT Q_DECL_I ...
分类:
其他好文 时间:
2017-07-29 21:33:13
阅读次数:
131
TCHAR是一种字符串类型,它让你在以MBCS和UNNICODE来build程序时可以使用同样的代码,不需要使用繁琐的宏定义来包含你的代码,而char代表ASCII的字符 #ifdef UNICODE typedef wchar_t TCHAR; #else typedef char TCHAR; ...
分类:
其他好文 时间:
2017-07-28 23:45:06
阅读次数:
179
时常看到别人的头文件中,有这样的代码: 这样的代码到底是什么意思呢?首先,__cplusplus是cpp中的自定义宏,那么定义了这个宏的话表示这是一段cpp的代码,也就是说,上面的代码的含义是:如果这是一段cpp的代码,那么加入extern "C"{,和 }处理其中的代码。 要明白为何使用exter ...
分类:
其他好文 时间:
2017-07-22 18:14:46
阅读次数:
160
引言 在用C++的项目源码中,经常会不可避免的会看到下面的代码: 1 2 3 4 5 6 7 8 9 #ifdef __cplusplus extern "C" { #endif /*...*/ #ifdef __cplusplus } #endif 1 2 3 4 5 6 7 8 9 #ifdef ...
分类:
编程语言 时间:
2017-07-19 17:43:57
阅读次数:
220
作者:刘昊昱 博客:http://blog.csdn.net/liuhaoyutz #include <stdio.h> #define HAOYU_DEBUG_TYPE #ifdef HAOYU_DEBUG_TYPE #define HAOYU_DEBUG(...) \ do { \ printf ...
分类:
其他好文 时间:
2017-07-17 23:46:59
阅读次数:
201
#ifndef _HIK_EVENT_H_ #define _HIK_EVENT_H_ #ifdef _MSC_VER #include <Windows.h> #define hik_event_handle HANDLE #else #include <pthread.h> typedef st ...