Re: [linux-minidisc] compiling libnetmd and netmdcli on windows
- From: Michael Karcher <Michael.Karcher@fu-berlin.de>
- To: Thomas Arp <manner.moe@gmx.de>
- Date: Thu, 15 Sep 2011 02:39:29 +0200
- Cc: linux-minidisc@lists.fu-berlin.de
- Subject: Re: [linux-minidisc] compiling libnetmd and netmdcli on windows
Am Mittwoch, den 14.09.2011, 23:51 +0200 schrieb Thomas Arp: > O.K., here is my patch, please review. Thanks for your patch. > diff --git a/libnetmd/common.c b/libnetmd/common.c > index 1f7b660..7e039ed 100644 > --- a/libnetmd/common.c > +++ b/libnetmd/common.c > @@ -62,7 +62,7 @@ static int netmd_poll(libusb_device_handle *dev, > unsigned char *buf, int tries) > } > > if (i > 0) { > - sleep(1); > + usleep(200000); > } > } usleep is probably not present in Visual C++, as it is a Unix function. mingw most likely supports it for compatiblity reasons. If the code should be even more portable, do use Sleep on Windows as you initially suggested. > -int min(int a,int b); > +#ifndef min > + #define min(a,b) ((a)<(b)?(a):(b)) > +#endif > + As it seems that utils.h is only included inside libhimd, this is fine. #define'ing min for public headers seems like a bad idea to me. Your patch is fine except for the usleep quirk. I don't know whether we care about non-GNU compilation on Windows, but if we do, we should not use usleep on Windows (as I said up there). Regards, Michael Karcher
- Follow-Ups:
- Re: [linux-minidisc] compiling libnetmd and netmdcli on windows
- From: Thomas Arp <manner.moe@gmx.de>
- Re: [linux-minidisc] compiling libnetmd and netmdcli on windows
- References:
- [linux-minidisc] compiling libnetmd and netmdcli on windows
- From: Thomas Arp <manner.moe@gmx.de>
- Re: [linux-minidisc] compiling libnetmd and netmdcli on windows
- From: Michael Karcher <Michael.Karcher@fu-berlin.de>
- Re: [linux-minidisc] compiling libnetmd and netmdcli on windows
- From: Thomas Arp <manner.moe@gmx.de>
- Re: [linux-minidisc] compiling libnetmd and netmdcli on windows
- From: Michael Karcher <Michael.Karcher@fu-berlin.de>
- Re: [linux-minidisc] compiling libnetmd and netmdcli on windows
- From: Thomas Arp <manner.moe@gmx.de>
- [linux-minidisc] compiling libnetmd and netmdcli on windows
-
linux-minidisc - September 2011 - Archives indexes sorted by:
[ thread ] [ subject ] [ author ] [ date ] - Complete archive of the linux-minidisc mailing list
- More info on this list...