牛骨文教育服务平台(让学习变的简单)
博文笔记

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

创建时间:2014-05-08 投稿人: 浏览次数:5230

参考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; 
})


声明:该文观点仅代表作者本人,牛骨文系教育信息发布平台,牛骨文仅提供信息存储空间服务。