On Sun, Aug 24, 2008 at 8:40 PM, Christian Franke <[EMAIL PROTECTED]> 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 <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. 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 _______________________________________________ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel