google-breakpad在C++ 11下编译错误修改
2016-07-14 00:00
465 查看
摘要: google-breakpad在C++ 11下编译错误修改
我只用到了exception_handler模块,暂时还未用到Server模块,因为用到了C++ 11的一些特性,而google-breadpad还没有C++11版本,所以做了一些修改,集中在类型定义处
1.
typedef typeof(((struct user*) 0)->u_debugreg[0]) debugreg_t;
修改为
#if __cplusplus > 199711L
typedef std::remove_reference<decltype(((struct user*) 0)->u_debugreg[0])>::type debugreg_t;
#else
typedef typeof(((struct user*) 0)->u_debugreg[0]) debugreg_t;
#endif
2.
typedef typeof(((elf_aux_entry*) 0)->a_un.a_val) elf_aux_val_t;
修改为
#if __cplusplus > 199711L
typedef decltype(((elf_aux_entry*) 0)->a_un.a_val) elf_aux_val_t;
#else
typedef typeof(((elf_aux_entry*) 0)->a_un.a_val) elf_aux_val_t;
#endif
因C++11中用了decltype来声明类型,所以做了兼容
我只用到了exception_handler模块,暂时还未用到Server模块,因为用到了C++ 11的一些特性,而google-breadpad还没有C++11版本,所以做了一些修改,集中在类型定义处
1.
typedef typeof(((struct user*) 0)->u_debugreg[0]) debugreg_t;
修改为
#if __cplusplus > 199711L
typedef std::remove_reference<decltype(((struct user*) 0)->u_debugreg[0])>::type debugreg_t;
#else
typedef typeof(((struct user*) 0)->u_debugreg[0]) debugreg_t;
#endif
2.
typedef typeof(((elf_aux_entry*) 0)->a_un.a_val) elf_aux_val_t;
修改为
#if __cplusplus > 199711L
typedef decltype(((elf_aux_entry*) 0)->a_un.a_val) elf_aux_val_t;
#else
typedef typeof(((elf_aux_entry*) 0)->a_un.a_val) elf_aux_val_t;
#endif
因C++11中用了decltype来声明类型,所以做了兼容
相关文章推荐
- Effective C++: extern
- C语言字符串相关函数大全
- 另类下载者轻松突破瑞星2010主动防御及ESET高启发
- C程序存储空间分布 c知识回顾第三天
- c++ 数据类型
- 自动查找函数地址的程序
- 任意分布的随机数的产生方法
- 内存加载SkinH.dll,不释放文件
- 致命错误 RC1121: RC : fatal error RC1121 : I/O error reading file
- MoveFileEx
- 一个sample学会使用c++比较函数对象和hash函数对象
- c++中while(cin>>str)和ctrl z的相关问题探讨
- POJ 2480 BZOJ 2705 Longge的问题
- C++ 11 : call a function on every item of a vector
- 深入理解C++类的构造函数与析构函数
- 李洪强漫谈iOS开发[C语言-010] - C语言简要复习
- C++实现线程池
- C++中的流对象
- HDU 1286 找新朋友
- 在win32dll中使用CString的方法