mn_version.hpp
Go to the documentation of this file.
1 
19 #ifndef _MINLIB_VERSION_H_
20 #define _MINLIB_VERSION_H_
21 
22 #define MN_THREAD_VERSION_STRING_LEN sizeof(MN_VERSION_FULLVERSION_STRING) + sizeof(MN_VERSION_STATUS) + 8
23 #define MN_THREAD_VERSION_INFO(PRJNAME) mn::minilib_version_print(PRJNAME)
24 
25 
26 #include "mn_config.hpp"
27 #include "mn_auto_version.hpp"
28 
30 
31 namespace mn {
32  inline const char* minilib_version_string(char version_string[MN_THREAD_VERSION_STRING_LEN]) {
33 
34  snprintf(version_string, MN_THREAD_VERSION_STRING_LEN, "%s-%s-LGPL", MN_VERSION_FULLVERSION_STRING,
36 
37  return version_string;
38  }
39  inline void minilib_version_print(const char* strPrjName, const char* strExtraInfo = "") {
40  char _version_string[MN_THREAD_VERSION_STRING_LEN];
41  minilib_version_string(_version_string);
42 
43  printf("%s using %s\n",strPrjName, _version_string);
44  if(strlen(strExtraInfo) > 0) {
45  printf("%s\n" , strExtraInfo);
46  }
47  }
48 }
50 
51 #endif
#define MN_VERSION_STATUS
Definition: mn_auto_version.hpp:13
#define MN_VERSION_FULLVERSION_STRING
Definition: mn_auto_version.hpp:26
#define MN_EXTERNC_BEGINN
Definition: mn_defines.hpp:49
#define MN_EXTERNC_END
Definition: mn_defines.hpp:50
#define MN_THREAD_VERSION_STRING_LEN
Definition: mn_version.hpp:22
Definition: mn_allocator_typetraits.hpp:25
void minilib_version_print(const char *strPrjName, const char *strExtraInfo="")
Definition: mn_version.hpp:39
const char * minilib_version_string(char version_string[MN_THREAD_VERSION_STRING_LEN])
Definition: mn_version.hpp:32