六狼论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博账号登陆

只需一步,快速开始

搜索
查看: 89|回复: 0

greta在vc express 2008下编译失败

[复制链接]

升级  42%

5

主题

5

主题

5

主题

童生

Rank: 1

积分
21
 楼主| 发表于 2013-1-27 05:28:28 | 显示全部楼层 |阅读模式
支持vc6和vs.net。在2008下产生C2923。
似乎是原有hetero_stack::stack_node::header结构现在不能看作类型了。

将原有code
struct stack_node{    struct header    {        stack_node * m_back;        stack_node * m_next;        byte_t     * m_current; // ptr into m_mem. alloc from here        byte_t     * m_end;     // ptr to last+1 byte_t in m_mem    };    union    {        header  m_head;        byte_t  m_align[ aligned_sizeof<header>::no_rtti ];    };    // This is the buffer into which values will be pushed and popped.    // It is guaranteed to meet the AlignmentT requirements because of    // the union above.    byte_t  m_mem[1];    size_t size() const // throw()    {        return static_cast<size_t>( m_head.m_end - m_mem );    }};
改为
struct stack_node_header;struct stack_node{    union    {        stack_node_header  m_head;        byte_t  m_align[ aligned_sizeof<stack_node_header>::no_rtti ];    };    // This is the buffer into which values will be pushed and popped.    // It is guaranteed to meet the AlignmentT requirements because of    // the union above.    byte_t  m_mem[1];    size_t size() const // throw()    {        return static_cast<size_t>( m_head.m_end - m_mem );    }};struct stack_node_header{    stack_node * m_back;    stack_node * m_next;    byte_t     * m_current; // ptr into m_mem. alloc from here    byte_t     * m_end;     // ptr to last+1 byte_t in m_mem};
并将引用:
byte_t      m_buf[ aligned_sizeof<stack_node::header>::no_rtti + StaticBlockSizeT ];
改为:
byte_t      m_buf[ aligned_sizeof<stack_node_header>::no_rtti + StaticBlockSizeT ];
编译通过。
您需要登录后才可以回帖 登录 | 立即注册 新浪微博账号登陆

本版积分规则

快速回复 返回顶部 返回列表