hversion.h 781 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #ifndef HV_VERSION_H_
  2. #define HV_VERSION_H_
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6. #include "hdef.h"
  7. #define HV_VERSION_MAJOR 1
  8. #define HV_VERSION_MINOR 20
  9. #define HV_VERSION_PATCH 3
  10. #define HV_VERSION_STRING STRINGIFY(HV_VERSION_MAJOR) "." \
  11. STRINGIFY(HV_VERSION_MINOR) "." \
  12. STRINGIFY(HV_VERSION_PATCH)
  13. #define HV_VERSION_NUMBER ((HV_VERSION_MAJOR << 16) | (HV_VERSION_MINOR << 8) | HV_VERSION_PATCH)
  14. static inline const char* hv_version() {
  15. return HV_VERSION_STRING;
  16. }
  17. const char* hv_compile_version();
  18. // 1.2.3.4 => 0x01020304
  19. int version_atoi(const char* str);
  20. // 0x01020304 => 1.2.3.4
  21. void version_itoa(int hex, char* str);
  22. #ifdef __cplusplus
  23. } // extern "C"
  24. #endif
  25. #endif // HV_VERSION_H_