[工具和软件] KDS的C语言有个__COUNT__怎么用?

[复制链接]
 楼主| forthlab 发表于 2015-12-14 19:46 | 显示全部楼层 |阅读模式
准备用来做软件的小版本号,使每次编译后的版本号都不一样;
但查不到定义和使用方法,
自己试了一下,出错
能告诉我如何用么?
原型定义在哪里?
NXP_TICS_Jeremy 发表于 2015-12-15 09:24 | 显示全部楼层
最简单方法,通过search功能,查找一下
春风的暖暖 发表于 2015-12-15 11:15 | 显示全部楼层
有一个search功能,你查找整个工程试一下
 楼主| forthlab 发表于 2015-12-15 17:41 | 显示全部楼层
NXP_TICS_Jeremy 发表于 2015-12-15 09:24
最简单方法,通过search功能,查找一下

我是看到help里面介绍有这个,
找不到说明
 楼主| forthlab 发表于 2015-12-17 08:20 | 显示全部楼层
谁知道如何用这个__COUNTER__
 楼主| forthlab 发表于 2015-12-21 17:29 | 显示全部楼层
文档里面查到的,但还是不会用;
编译出错!
=================================

Predefined Macros
The compiler preprocessor has predefined macros (some refer to these as predefined
symbols). The compiler simulates variable definitions that describe the compile-time
environment and properties of the target processor.
This chapter lists the predefined macros that all CodeWarrior compilers make available.
• __COUNTER__
• __cplusplus
• __CWCC__
• __embedded_cplusplus
• __FILE__
• __func__
• __FUNCTION__
• __ide_target()
• __LINE__
• __MWERKS__
• __PRETTY_FUNCTION__
• __profile__
• __STDC__
• __TIME__
__COUNTER__
Preprocessor macro that expands to an integer.
Syntax
__COUNTER__
Remarks
The compiler defines this macro as an integer that has an initial value of 0
incrementing by 1 every time the macro is used in the translation unit.
The value of this macro is stored in a precompiled header and is restored when the
precompiled header is used by a translation unit.
您需要登录后才可以回帖 登录 | 注册

本版积分规则

87

主题

749

帖子

5

粉丝
快速回复 在线客服 返回列表 返回顶部

87

主题

749

帖子

5

粉丝
快速回复 在线客服 返回列表 返回顶部