From ff6000745886cb085ca80e42498020497bc7f95f Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Sun, 3 Apr 2011 22:23:14 +0000 Subject: Fix build with NDEBUG defined svn path=/trunk/netsurf/; revision=12154 --- utils/log.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'utils/log.c') diff --git a/utils/log.c b/utils/log.c index 31ca89d13..0f9290bf7 100644 --- a/utils/log.c +++ b/utils/log.c @@ -28,9 +28,6 @@ #include "utils/utils.h" #include "utils/log.h" -static struct timeval start_tv; -static char buff[32]; - nserror nslog_init(nslog_ensure_t *ensure, int *pargc, char **argv) { nserror ret = NSERROR_OK; @@ -59,9 +56,13 @@ nserror nslog_init(nslog_ensure_t *ensure, int *pargc, char **argv) return ret; } +#ifndef NDEBUG const char *nslog_gettime(void) { + static struct timeval start_tv; + static char buff[32]; + struct timeval tv; struct timeval now_tv; @@ -72,7 +73,9 @@ const char *nslog_gettime(void) timeval_subtract(&tv, &now_tv, &start_tv); - snprintf(buff, sizeof(buff),"(%ld.%ld)", (long)tv.tv_sec, (long)tv.tv_usec); + snprintf(buff, sizeof(buff),"(%ld.%ld)", + (long)tv.tv_sec, (long)tv.tv_usec); + return buff; } @@ -89,3 +92,5 @@ void nslog_log(const char *format, ...) } } +#endif + -- cgit v1.2.3