5 years, 7 months ago.

VERSION, or __VERSION__ macro available?

Soon after the version control capability was announced, there was a request for a VERSION macro. Has this been implemented?

Question relating to:

1 Answer

5 years, 7 months ago.

Hello David Smart,

that macro is not yet there, if you mean mbed library revision (= version). I'll bring this up to the team. Thanks.


Accepted Answer

Hi Martin, thanks for the fast response. Actually, I was hoping for the version number reported by the version control system, so every commit can be uniquely identified in the binary. There is a small flaw in this logic - you would first have to commit the new version, and then build from that version. And, in the context of the build with several components, which is it drawing the version number from?

I use DATE and TIME in pretty much everything today, but it would be handy if a program (or library module) were somewhat self-reporting.

posted by David Smart 14 Jun 2014

Let me correct myself, I just remembered , there's macro MBED_LIBRARY_VERSION in the mbed header file. This says which revision of mbed library an application is using. Not yet what you hoped. The timebuild stamp is set as global macro.

posted by Martin Kojtal 15 Jun 2014