mirror of
https://github.com/mariusgreuel/avrdude.git
synced 2025-12-17 02:54:17 +00:00
Cleanup Cygwin builds.
* windows/Makefile.am (loaddrv_LDFLAGS): remove, the -mno-cygwin flag is supposed to be set in CFLAGS by ./configure * configure.ac: add a check for the presence of usleep(), add a check whether the linker accepts -static * avrdude.h: protect prototype for usleep by !defined(HAVE_USLEEP) * ppwin.c (usleep): protect by !defined(HAVE_USLEEP) * main.c: silence "array subscript of type char" compiler warnings by casting all arguments to tolower()/toupper() and isspace()/ isdigit()/ispunct() to "int" * butterfly.c: (Dito.) * avr910.c: (Dito.) git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@936 81a1dc3b-b13d-400b-aceb-764788c761c2
This commit is contained in:
8
ppiwin.c
8
ppiwin.c
@@ -374,6 +374,7 @@ int gettimeofday(struct timeval *tv, struct timezone *unused){
|
||||
|
||||
#endif
|
||||
|
||||
#if !defined(HAVE_USLEEP)
|
||||
int usleep(unsigned int us)
|
||||
{
|
||||
int has_highperf;
|
||||
@@ -384,7 +385,7 @@ int usleep(unsigned int us)
|
||||
// verify - increasing the delay helps sometimes but not
|
||||
// realiably. There must be some other problem. Maybe just
|
||||
// with my test-hardware maybe in the code-base.
|
||||
//// us=(unsigned long) (us*1.5);
|
||||
//// us=(unsigned long) (us*1.5);
|
||||
|
||||
has_highperf=QueryPerformanceFrequency(&freq);
|
||||
|
||||
@@ -393,7 +394,7 @@ int usleep(unsigned int us)
|
||||
if (has_highperf) {
|
||||
QueryPerformanceCounter(&start);
|
||||
loopend.QuadPart=start.QuadPart+freq.QuadPart*us/(1000*1000);
|
||||
do {
|
||||
do {
|
||||
QueryPerformanceCounter(&stop);
|
||||
} while (stop.QuadPart<=loopend.QuadPart);
|
||||
}
|
||||
@@ -405,11 +406,12 @@ int usleep(unsigned int us)
|
||||
|
||||
DEBUG_QueryPerformanceCounter(&stop);
|
||||
}
|
||||
|
||||
|
||||
DEBUG_DisplayTimingInfo(start, stop, freq, us, has_highperf);
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif /* !HAVE_USLEEP */
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user