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



_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to