ivversion.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. #ifndef IVVERSION_H
  2. #define IVVERSION_H
  3. #include "ivversion_def.h" //Please use common.pri, If you don't want use ivversion_def.h can comment this line.
  4. #ifndef IVVERSION
  5. #define IVVERSION "1.1.0-develop"
  6. #endif
  7. //#include <iostream>
  8. //#include <stdio.h>
  9. //#include <fstream>
  10. //#include <string.h>
  11. //#include <QFile>
  12. //std::string getgitversion()
  13. //{
  14. // std::string strrtn;
  15. // bool bfileok = false;
  16. // char strpath[256];
  17. // char strtem[256];
  18. // char strbase[256];
  19. // snprintf(strbase,256,"./.git/refs/heads/master");
  20. // snprintf(strtem,256,"./.");
  21. // int i;
  22. // for(i=0;i<5;i++)
  23. // {
  24. // strncpy(strpath,strtem,256);
  25. // int j;
  26. // for(j=0;j<i;j++)strncat(strpath,strtem,256);
  27. // strncat(strpath,strbase,256);
  28. // std::ifstream f(strpath);
  29. // if(f.good())
  30. // {
  31. // char strdata[256];
  32. // f.read(strdata,256);
  33. // if(f.gcount()>0)strrtn.append(strdata,f.gcount());
  34. // // std::cout<<"file ok"<<"size is "<<f.gcount()<<std::endl;
  35. // bfileok = true;
  36. // f.close();
  37. // break;
  38. // }
  39. // else
  40. // {
  41. // // std::cout<<" not ok"<<std::endl;
  42. // }
  43. // }
  44. // if(bfileok == false)
  45. // {
  46. // strrtn = VERSION;
  47. // }
  48. // return strrtn;
  49. //}
  50. #define showversion(modulename) do{std::cout<<"ADC IV Version:"<<IVVERSION<<" | Module name: "<<modulename<<" | Build Time: "<<__DATE__<<" "<<__TIME__<<std::endl;}while(0);
  51. //#define showversion(modulename) do{std::cout<<"ADC IV Version:"<<getgitversion()<<" | Module name: "<<modulename<<" | Build Time: "<<__DATE__<<" "<<__TIME__<<std::endl;}while(0);
  52. #endif