网站公告列表

  没有公告

加入收藏
设为首页
联系本站
您现在的位置: Analog安诺电子网 >> 文章 >> 技术交流 >> 文章正文
  U-boot-1.1.6-2008R1到vdsp5(bf561)的移植记录(9):bool的问题           ★★★ 【字体:
U-boot-1.1.6-2008R1到vdsp5(bf561)的移植记录(9):bool的问题
作者:快乐虾    文章来源:http://blog.csdn.net/lights_joy    点击数:    更新时间:2008-4-21    
在u-boot\include\asm\posix_type.h中有这样一个定义:
typedef enum { false = 0, true = 1 } bool;
但是在VDSP5中将引起一个错误:
"..\..\include\asm/posix_types.h", line 63: cc0040: error: expected an
          identifier
 typedef enum { false = 0, true = 1 } bool;
因为VDSP5是将false和true做为内置类型来处理的:
The bool, true, and false keywords are extensions that support the C++ boolean type in C mode. The bool keyword is a unique signed integral type, just as the wchar_t is a unique unsigned type. There are two built-in constants of this type: true and false. When converting a numeric or pointer value to bool, a zero value becomes false, and a nonzero value becomes true. A bool value may be converted to int by promotion, taking true to one and false to zero. A numeric or pointer value is converted automatically to bool when needed.
 
These keyword extensions behave as if the declaration that follows had appeared at the beginning of the file, except that assigning a nonzero integer to a bool type causes it to take on the value true.
 
   typedef enum { false, true } bool;
所以重新定义bool就是画蛇添足了,直接注释掉。
文章录入:admin    责任编辑:admin 
  • 上一篇文章:

  • 下一篇文章:
  • 发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口
    最新热点 最新推荐 相关文章
    U-boot-1.1.6-2008R1到vdsp5
    U-boot-1.1.6-2008R1到vdsp5
    U-boot-1.1.6-2008R1到vdsp5
    数据采集系统设计的思考
    数字电位器
    常用数字电位器AD7376A/AD52
    使用KEILUV3开发高性能单片机
    集成运放综合参数测试仪
    U-boot-1.1.6-2008R1到vdsp5
    U-boot-1.1.6-2008R1到vdsp5
      网友评论:(只显示最新10条。评论内容只代表网友观点,与本站立场无关!)
    版权所有:Analog安诺电子网 湘ICP备06016315号