diff options
author | martin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220> | 2011-01-24 16:43:55 +0000 |
---|---|---|
committer | martin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220> | 2011-01-24 16:43:55 +0000 |
commit | 4a6f7e04eae01c60d7d7d646bff8206f8cf55ebf (patch) | |
tree | 6444e9b03b04c2d3abf86fa7defe2d1737054f92 /navit/log.c | |
parent | b7f7ea8fe02102e2af38612fc6954a9d637ae11b (diff) | |
download | navit-4a6f7e04eae01c60d7d7d646bff8206f8cf55ebf.tar.gz |
Fix:Core:MSVC fixes|Thanks chollya
git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit@3998 ffa7fe5e-494d-0410-b361-a75ebd5db220
Diffstat (limited to 'navit/log.c')
-rw-r--r-- | navit/log.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/navit/log.c b/navit/log.c index e2e542a78..8874eca7f 100644 --- a/navit/log.c +++ b/navit/log.c @@ -17,14 +17,18 @@ * Boston, MA 02110-1301, USA. */ +#ifdef HAVE_UNISTD_H #include <unistd.h> +#endif +#ifdef HAVE_SYS_TIME_H +#include <sys/time.h> +#endif #include <fcntl.h> #include <stdarg.h> #include <stdio.h> #include <string.h> #include <stdlib.h> #include <time.h> -#include <sys/time.h> #include <glib.h> #include "file.h" #include "item.h" @@ -49,7 +53,9 @@ struct log { int flush_time; struct event_timeout *timer; struct callback *timer_callback; +#ifdef HAVE_SYS_TIME_H struct timeval last_flush; +#endif char *filename; char *filename_ex1; char *filename_ex2; @@ -97,7 +103,9 @@ expand_filenames(struct log *this_) static void log_set_last_flush(struct log *this_) { +#ifdef HAVE_SYS_TIME_H gettimeofday(&this_->last_flush, NULL); +#endif } static void @@ -204,6 +212,7 @@ log_change_required(struct log *this_) static void log_timer(struct log *this_) { +#ifdef HAVE_SYS_TIME_H struct timeval tv; int delta; gettimeofday(&tv, NULL); @@ -211,6 +220,7 @@ log_timer(struct log *this_) dbg(1,"delta=%d flush_time=%d\n", delta, this_->flush_time); if (this_->flush_time && delta >= this_->flush_time*1000) log_flush(this_,0); +#endif } int |