All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christian Franke <Christian.Franke@t-online.de>
To: The development of GRUB 2 <grub-devel@gnu.org>
Subject: Re: [PATCH] Mingw support for grub2
Date: Sun, 24 Aug 2008 14:40:53 +0200	[thread overview]
Message-ID: <48B156D5.4020203@t-online.de> (raw)
In-Reply-To: <ca0f59980808230711t2fdabb4ev448f2851c7e77222@mail.gmail.com>

Bean wrote:
> Hi,
>
> This patch add support for mingw, now you can create native executable
> for windows.
>
>   

Nice!

Does grub-setup work?


> ...
> --- a/include/grub/util/misc.h
> +++ b/include/grub/util/misc.h
> ...
> +#ifdef __MINGW32__
> +
> +#include <windows.h>
> +
> +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.


> +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.


> +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 :-)


Christian




  reply	other threads:[~2008-08-24 12:41 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-23 14:11 [PATCH] Mingw support for grub2 Bean
2008-08-24 12:40 ` Christian Franke [this message]
2008-08-24 12:48   ` Felix Zielcke
2008-08-24 15:11     ` Bean
2008-08-24 15:25       ` Felix Zielcke
2008-08-24 15:31         ` Bean
2008-08-24 15:49           ` Bean
2008-08-24 14:12   ` Bean
2008-08-24 16:04     ` Vesa Jääskeläinen
2008-08-24 16:14       ` Bean
2008-08-24 16:16         ` Vesa Jääskeläinen
2008-08-24 16:42           ` Christian Franke
2008-08-29 19:59             ` Bean

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=48B156D5.4020203@t-online.de \
    --to=christian.franke@t-online.de \
    --cc=grub-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.