Uwe Hermann <uwe@hermann-uwe.de> One of them is fixing a few compiler warnings (see...
[fw/openocd] / src / helper / replacements.c
index 7a6729b8129f6938243f9f39022c2a4227453209..b6ddfd7c562082c9db9cd3a98b23e3ba1ace9bef 100644 (file)
@@ -2,6 +2,12 @@
  *   Copyright (C) 2006 by Dominic Rath                                    *
  *   Dominic.Rath@gmx.de                                                   *
  *                                                                         *
+ *   Copyright (C) 2007,2008 Ã˜yvind Harboe                                 *
+ *   oyvind.harboe@zylin.com                                               *
+ *                                                                         *
+ *   Copyright (C) 2008 by Spencer Oliver                                  *
+ *   spen@spen-soft.co.uk                                                  *
+ *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
  *   it under the terms of the GNU General Public License as published by  *
  *   the Free Software Foundation; either version 2 of the License, or     *
@@ -25,7 +31,9 @@
 
 #include <stdlib.h>
 #include <string.h>
+#ifdef HAVE_STRINGS_H
 #include <strings.h>
+#endif
 /* 
  * clear_malloc
  *
@@ -74,19 +82,19 @@ void *fill_malloc(size_t size)
 
 int gettimeofday(struct timeval *tv, struct timezone *tz)
 {
-       FILETIME        ft;
-       LARGE_INTEGER   li;
-       __int64         t;
-       static int      tzflag;
+       FILETIME ft;
+       LARGE_INTEGER li;
+       __int64 t;
+       static int tzflag;
 
        if (tv)
        {
                GetSystemTimeAsFileTime(&ft);
                li.LowPart  = ft.dwLowDateTime;
                li.HighPart = ft.dwHighDateTime;
-               t  = li.QuadPart;                   /* In 100-nanosecond intervals */
-               t -= EPOCHFILETIME;                 /* Offset to the Epoch time */
-               t /= 10;                            /* In microseconds */
+               t  = li.QuadPart;                                       /* In 100-nanosecond intervals */
+               t -= EPOCHFILETIME;                                     /* Offset to the Epoch time */
+               t /= 10;                                                        /* In microseconds */
                tv->tv_sec  = (long)(t / 1000000);
                tv->tv_usec = (long)(t % 1000000);
        }