avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] avrdude on cygwin


From: Joerg Wunsch
Subject: Re: [avr-gcc-list] avrdude on cygwin
Date: Wed, 19 Nov 2008 22:44:54 +0100 (MET)

Ruud Vlaming <address@hidden> wrote:

> The reason is pretty obvious, the unistd.h file is included which
> contains the definition:
>   int __cdecl __MINGW_NOTHROW usleep(useconds_t useconds);
> 
> whereas avrdude.h contains
>   void usleep(unsigned long us);

Does the patch below make it compile?

If not, I could add a feature test for it to configure.ac, and then
encapsulate the avrdude private definition in #if
!defined(HAVE_USLEEP).

Index: avrdude.h
===================================================================
RCS file: /home/cvs/avrdude/avrdude/avrdude.h,v
retrieving revision 1.2
diff -u -u -r1.2 avrdude.h
--- avrdude.h   24 Jan 2007 22:43:46 -0000      1.2
+++ avrdude.h   19 Nov 2008 21:43:43 -0000
@@ -46,7 +46,7 @@
  #define ANTIWARP 3
  #define usleep(us) Sleep(us/1000*ANTIWARP)
 */
-void usleep(unsigned long us);
+int usleep(unsigned int us);
 
 #if !defined(HAVE_GETTIMEOFDAY)
 struct timezone;
Index: ppiwin.c
===================================================================
RCS file: /home/cvs/avrdude/avrdude/ppiwin.c,v
retrieving revision 1.13
diff -u -u -r1.13 ppiwin.c
--- ppiwin.c    5 Nov 2008 20:53:51 -0000       1.13
+++ ppiwin.c    19 Nov 2008 21:44:15 -0000
@@ -374,7 +374,7 @@
 
 #endif
 
-void usleep(unsigned long us)
+int usleep(unsigned int us)
 {
        int has_highperf;
        LARGE_INTEGER freq,start,stop,loopend;
@@ -407,6 +407,8 @@
        }
        
     DEBUG_DisplayTimingInfo(start, stop, freq, us, has_highperf);
+
+    return 0;
 }
 
 #endif

-- 
cheers, J"org               .-.-.   --... ...--   -.. .  DL8DTL

http://www.sax.de/~joerg/                        NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]