您的位置:首页 > 编程语言 > C语言/C++

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来声明类型,所以做了兼容
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: