google-breakpad在 C++11下编译错误 ISO C++ forbids declaration of ‘typeof’ with no type

115 篇文章 0 订阅

参考https://code.google.com/p/google-breakpad/issues/detail?id=481


ISO C++ forbids declaration of ‘typeof’ with no type

typedef ‘google_breakpad::typeof’ is initialized (use decltype instead)



因为 C++11 把 关键字typeof改为decltype
具体有两个地方要改的:


第一个文件:linux_dumper.h

typedef  typeof(((elf_aux_entry*) 0)->a_un.a_val)  elf_aux_val_t;

第二个文件:eintr_wrapper.h

#define HANDLE_EINTR(x) ({ \
  typeof(x) eintr_wrapper_result; \
  do { \
    eintr_wrapper_result = (x); \
  } while (eintr_wrapper_result == -1 && errno == EINTR); \
  eintr_wrapper_result; \
})

#define IGNORE_EINTR(x) ({ \
  typeof(x) eintr_wrapper_result; \
  do { \
    eintr_wrapper_result = (x); \
    if (eintr_wrapper_result == -1 && errno == EINTR) { \
      eintr_wrapper_result = 0; \
    } \
  } while (0); \
  eintr_wrapper_result; \
})


评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值