can i get compilation version to promote by one and use in code in c++
i have meany compilations that each time i done compilation i move it to dyploy dir also i have debug and release versions , im getting lost here . my question is is there any way to promote some global variable by 1 each time im done compiling , maybe also getting the compilation type (debug oe release ) then i like to use this string in code: im using visual studio express 2008
something like :
Code:
std::string ver = VISUAL_STUDIO_MACRO_VERSIONING
if(ver > prev_ver)
{
..do something ..
like print to log
}
Re: can i get compilation version to promote by one and use in code in c++
you can use _MFC_VER and _DEBUG
examples:
#if _MSC_VER < 1202
//EVC 4.0 complier is cross 1200 - 1202
#else if _MSC_VER >= 1400
//Visual C++ 2005 complier is 1400
#else
//Visual C++ 2005 complier is 1400
#endif
///////////////////////////////////////
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
Re: can i get compilation version to promote by one and use in code in c++
Thanks , but i dont understand how can i automatically promote it by one each compilation
how it can remember the last number , file ?
Re: can i get compilation version to promote by one and use in code in c++