dbghlp.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. // dbghlp.h :
  2. //
  3. #if !defined(AGD_DBGHLP_H__43902563_76A4_4ADC_8FA2_DD924EAAA095__INCLUDED_)
  4. #define AGD_DBGHLP_H__43902563_76A4_4ADC_8FA2_DD924EAAA095__INCLUDED_
  5. #include <stdint.h>
  6. #include <stdbool.h>
  7. #include <time.h>
  8. #ifdef __cplusplus
  9. extern "C" {
  10. #endif // __cplusplus
  11. /////////////////////////////////////////////////////////////////////////////
  12. // dbghlp.h - Declarations:
  13. #ifdef _DEBUG
  14. #define TRACE(...) printf(__VA_ARGS__), fflush(stdout)
  15. #else // _DEBUG
  16. #define TRACE(...)
  17. #endif // _DEBUG
  18. /////////////////////////////////////////////////////////////////////////////
  19. uint64_t Timeval2Us(const struct timeval *ptv);
  20. const struct timeval* Us2Timeval(uint64_t usTime, struct timeval *ptv);
  21. uint64_t Timespec2Ns(const struct timespec *pts);
  22. const struct timespec* Ns2Timespec(uint64_t nsTime, struct timespec *pts);
  23. int64_t TimespecDiff(const struct timespec *pts1, const struct timespec *pts2);
  24. void GetTimespec(struct timespec *pts);
  25. /////////////////////////////////////////////////////////////////////////////
  26. #ifdef __cplusplus
  27. }
  28. #endif // __cplusplus
  29. #endif // !defined(AGD_DBGHLP_H__43902563_76A4_4ADC_8FA2_DD924EAAA095__INCLUDED_)