hversion.h 728 B

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