From: Alex Henrie alexhenrie24@gmail.com
--- include/wine/debug.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+)
diff --git a/include/wine/debug.h b/include/wine/debug.h index 86e008a1408..fe3013af1bf 100644 --- a/include/wine/debug.h +++ b/include/wine/debug.h @@ -334,6 +334,27 @@ static inline const char *wine_dbgstr_fourcc( unsigned int fourcc ) return wine_dbg_sprintf( "0x%08x", fourcc ); }
+static inline const char *wine_dbgstr_reftime( LONGLONG time ) +{ + ULONGLONG abstime = time >= 0 ? time : -time; + unsigned int i = 0, j = 0; + char buffer[23], rev[23]; + + while (abstime || i <= 8) + { + buffer[i++] = '0' + (abstime % 10); + abstime /= 10; + if (i == 7) buffer[i++] = '.'; + } + if (time < 0) buffer[i++] = '-'; + + while (i--) rev[j++] = buffer[i]; + while (rev[j-1] == '0' && rev[j-2] != '.') --j; + rev[j] = 0; + + return wine_dbg_sprintf( "%s", rev ); +} + static inline const char *wine_dbgstr_point( const POINT *pt ) { if (!pt) return "(null)"; @@ -515,6 +536,7 @@ static inline const char *debugstr_an( const char * s, int n ) { return wine_dbg static inline const char *debugstr_wn( const WCHAR *s, int n ) { return wine_dbgstr_wn( s, n ); } static inline const char *debugstr_guid( const struct _GUID *id ) { return wine_dbgstr_guid(id); } static inline const char *debugstr_fourcc( unsigned int cc ) { return wine_dbgstr_fourcc( cc ); } +static inline const char *debugstr_reftime( LONGLONG time ) { return wine_dbgstr_reftime( time ); } static inline const char *debugstr_a( const char *s ) { return wine_dbgstr_an( s, -1 ); } static inline const char *debugstr_w( const WCHAR *s ) { return wine_dbgstr_wn( s, -1 ); }