Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1KXGKU-0002vg-OI for mharc-grub-devel@gnu.org; Sun, 24 Aug 2008 10:12:30 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KXGKS-0002tq-Dq for grub-devel@gnu.org; Sun, 24 Aug 2008 10:12:28 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KXGKQ-0002sB-QZ for grub-devel@gnu.org; Sun, 24 Aug 2008 10:12:28 -0400 Received: from [199.232.76.173] (port=39230 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KXGKQ-0002rp-I0 for grub-devel@gnu.org; Sun, 24 Aug 2008 10:12:26 -0400 Received: from ti-out-0910.google.com ([209.85.142.188]:26516) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KXGKP-0002TS-Rk for grub-devel@gnu.org; Sun, 24 Aug 2008 10:12:26 -0400 Received: by ti-out-0910.google.com with SMTP id u5so677402tia.10 for ; Sun, 24 Aug 2008 07:12:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=28CCETTVDOX+1KveK3ROuZolmKmJnE7lC2yVAAVaw80=; b=rJubTPdSI/YB2sL3dAAto5f8RqKr/5CbdITe00mE1KJG7SDPmibzygDJmkf0XU+wWD SeTNp9pZIs/khPE0Mv4cbRtGiToTXgQEfqFhXT47Cum4eHpnASfPSnDmL6GufDGBboPT etDuQeD0DTBpP0amX57KBEKQsyuYHmihRV5+s= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=WKvFsJ0iaNYmyqEQnsApb/EDK+cHKY0Uya3Qas+tUV2cuVH+81L0Cf7VW4TmEbg0l/ LjTajdXVr8i80DHIaiXZvKkhCQItlGKRqpPUlVNRT1bQXTDS7oDulJ2GH4em4SQO16M1 ei2GefNJU6kpBU+SZDVMfvZgnGnfvVHl0G2OA= Received: by 10.110.21.4 with SMTP id 4mr3762610tiu.28.1219587143163; Sun, 24 Aug 2008 07:12:23 -0700 (PDT) Received: by 10.110.16.5 with HTTP; Sun, 24 Aug 2008 07:12:23 -0700 (PDT) Message-ID: Date: Sun, 24 Aug 2008 22:12:23 +0800 From: Bean To: "The development of GRUB 2" In-Reply-To: <48B156D5.4020203@t-online.de> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <48B156D5.4020203@t-online.de> X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 2) Subject: Re: [PATCH] Mingw support for grub2 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Aug 2008 14:12:28 -0000 On Sun, Aug 24, 2008 at 8:40 PM, Christian Franke wrote: > Bean wrote: >> >> Hi, >> >> This patch add support for mingw, now you can create native executable >> for windows. >> >> > > Nice! > > Does grub-setup work? Yes, it works, although mingw can't use device names like /dev/sda, but it can use windows special name //./PHYSICALDRIVE0. > > >> ... >> --- a/include/grub/util/misc.h >> +++ b/include/grub/util/misc.h >> ... >> +#ifdef __MINGW32__ >> + >> +#include >> + >> +grub_int64_t fseeko (FILE *fp, grub_int64_t offset, int whence); >> +grub_int64_t ftello (FILE *fp); >> > > The mingw runtime provides fseeko64/ftello64(), see > /usr/include/mingw/stdio.h > > So the following may work: > > #ifdef __MINGW32__ > #define fseeko fseeko64 > #define ftello ftello64 > #endif > > or use inline functions. Oh, thanks for the tip. > > >> +void sync (void); >> +int asprintf (char **buf, const char *fmt, ...); >> + >> > > I would suggest to add AC_CHECK_FUNC(asprintf) to configure. > asprintf() is a GNU extension and not part of C99 or POSIX. > Good point. > >> +grub_int64_t grub_util_get_disk_size (char *name); >> + >> +#define sleep Sleep >> > > The Sleep() parameter specifies milliseconds. > > #define sleep(s) Sleep((s)*1000) > or > inline void sleep(unsigned s) { Sleep(s * 1000); } > or > add sleep() to util/misc.c to avoid global inclusion of the namespace > polluter windows.h :-) Yes, perhaps I should put it in util/misc.c. -- Bean