mirror of
https://github.com/troglobit/finit.git
synced 2026-11-08 16:11:10 +00:00
1 parent
804aa3c747
commit
dfed328d47
1 file changed
+5
-5
+5
-5
@@ -131,7 +131,9 @@ static int debug = 0;
|
|||||||
|
|
||||||
#ifdef DEBUG_TIMESTAMP
|
#ifdef DEBUG_TIMESTAMP
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
int _d(char *fmt, ...)
|
#include <stdarg.h>
|
||||||
|
|
||||||
|
void _d(char *fmt, ...)
|
||||||
{
|
{
|
||||||
va_list ap;
|
va_list ap;
|
||||||
struct timeval t;
|
struct timeval t;
|
||||||
@@ -141,13 +143,11 @@ int _d(char *fmt, ...)
|
|||||||
|
|
||||||
va_start(ap, fmt);
|
va_start(ap, fmt);
|
||||||
|
|
||||||
gettimeofday(&t);
|
gettimeofday(&t, NULL);
|
||||||
printf("[%d.%03d] ", t.tv_sec, t.tv_usec / 1000);
|
printf("[%ld.%03ld] ", t.tv_sec, t.tv_usec / 1000);
|
||||||
vprintf(fmt, ap);
|
vprintf(fmt, ap);
|
||||||
printf("\n");
|
printf("\n");
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
#define _d(x...) do { if (debug) printf(x); printf("\n"); } while (0)
|
#define _d(x...) do { if (debug) printf(x); printf("\n"); } while (0)
|
||||||
|
|||||||
Reference in new issue
Block a user