Home » U++ TheIDE » U++ TheIDE: Other Features Wishlist and/or Bugs » Versioning support (hack-ishly solved)
Re: Versioning support [message #52190 is a reply to message #52155] |
Wed, 07 August 2019 14:17 |
slashupp
Messages: 231 Registered: July 2009
|
Experienced Member |
|
|
I came up with the following macro that can do version-support.
It "key-jack"s F7 and it would also be nice if it can overload the toolbar-button.
for the macro to work it needs the following header to be part of the main package files:
Name: VersionRBT.h
#ifndef _VersionRBT_h_
#define _VersionRBT_h_
#define V_RELEASE 0
#define V_BUILD 0
#define V_TEST 0
#define N_2_S0(x) #x
#define N_2_S(x) N_2_S0(x)
#define V_VERSION "v " N_2_S(V_RELEASE) "." N_2_S(V_BUILD) "." N_2_S(V_TEST)
#endif
The #defines can be used wherever needed and the V_VERSION is just a convenient string representation.
The Versioning-macro updates the #define counts (and restore if the build fails) before the package is compiled
making the new version current for the compiled code.
Just use the V_defines where needed, they will always be current.
To test it, add the above header and import the macro ([Setup->Macro Manager.. then R-click the "Global macros"-tree and Import..])
#include <CtrlLib/CtrlLib.h>
using namespace Upp;
#include "VersionRBT.h"
GUI_APP_MAIN
{
PromptOK("tester: " V_VERSION);
}
[Updated on: Wed, 07 August 2019 15:16] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Fri Apr 19 15:17:42 CEST 2024
Total time taken to generate the page: 0.02048 seconds
|