]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
Allow compilation with mingw64 albeit with warnings due to lack of
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Tue, 15 Oct 2013 16:03:19 +0000 (18:03 +0200)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Tue, 15 Oct 2013 16:03:19 +0000 (18:03 +0200)
%llx/%llu.

* grub-core/gnulib/msvc-inval.c: Use __cdecl rather than cdecl.
* grub-core/lib/posix_wrap/wchar.h: Define wint_t.
* grub-core/lib/posix_wrap/wctype.h: Define wctype_t.
* include/grub/osdep/hostfile_windows.h: Don't define fseeko/ftello
on mingw64.
* include/grub/types.h: Allow sizeof (long) != sizeof (void *).

ChangeLog
grub-core/gnulib/msvc-inval.c
grub-core/lib/posix_wrap/wchar.h
grub-core/lib/posix_wrap/wctype.h
include/grub/osdep/hostfile_windows.h
include/grub/types.h

index e083e56a04ce962e7a00dc690ce48b974c8c1408..8039424121651f16a90b5e08e349b45e351daaee 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2013-10-15  Vladimir Serbinenko  <phcoder@gmail.com>
+
+       Allow compilation with mingw64 albeit with warnings due to lack of
+       %llx/%llu.
+
+       * grub-core/gnulib/msvc-inval.c: Use __cdecl rather than cdecl.
+       * grub-core/lib/posix_wrap/wchar.h: Define wint_t.
+       * grub-core/lib/posix_wrap/wctype.h: Define wctype_t.
+       * include/grub/osdep/hostfile_windows.h: Don't define fseeko/ftello
+       on mingw64.
+       * include/grub/types.h: Allow sizeof (long) != sizeof (void *).
+
 2013-10-15  Vladimir Serbinenko  <phcoder@gmail.com>
 
        Remove leftover references to some of the system headers.
index 72a6b6ee89de1a7c3752cb8666ee440bbccdacc2..7e57731eb1acc4f700b081d64d0b80c8b3bf5784 100644 (file)
@@ -28,7 +28,7 @@
 
 # if MSVC_INVALID_PARAMETER_HANDLING == DEFAULT_HANDLING
 
-static void cdecl
+static void __cdecl
 gl_msvc_invalid_parameter_handler (const wchar_t *expression,
                                    const wchar_t *function,
                                    const wchar_t *file,
index d5d7741dec9da4c84c1a8e7c49289ffba8e173d1..e0e04a6a0ef9f35a95565c989d221d0468753b3c 100644 (file)
@@ -21,6 +21,7 @@
 
 #include <grub/charset.h>
 
+#define wint_t grub_posix_wint_t
 #define wchar_t grub_posix_wchar_t
 #define mbstate_t grub_posix_mbstate_t
 
index 0dab48b976e12133050636e464bea798bcfac945..3771dc5cb33e99caf2f0bb55294c5a5c5924976b 100644 (file)
@@ -22,6 +22,8 @@
 #include <grub/misc.h>
 #include <wchar.h>
 
+#define wctype_t grub_posix_wctype_t
+
 typedef enum { GRUB_CTYPE_INVALID,
               GRUB_CTYPE_ALNUM, GRUB_CTYPE_CNTRL, GRUB_CTYPE_LOWER,
               GRUB_CTYPE_SPACE, GRUB_CTYPE_ALPHA, GRUB_CTYPE_DIGIT,
index 21419de3c499a34755bafb523e732b75fdd5bcdb..13c4cb650f7cbb4d08a090616c21f56c49133c48 100644 (file)
@@ -64,6 +64,12 @@ enum grub_util_fd_open_flags_t
     GRUB_UTIL_FD_O_SYNC = 0,
   };
 
+#if defined (__MINGW32__) && !defined (__MINGW64__)
+
+#define fseeko fseeko64
+
+#endif
+
 LPTSTR
 grub_util_utf8_to_tchar (const char *in);
 char *
@@ -73,9 +79,6 @@ grub_util_tchar_to_utf8 (LPCTSTR in);
 
 int fsync (int fno);
 
-#define fseeko fseeko64
-#define ftello ftello64
-
 #endif
 
 #endif
index 7c6c28601b855199c9fbd11b96987ddb893421ab..1620227cd20a5d37e0735075cd0de61765159e7a 100644 (file)
 # endif
 #endif /* ! GRUB_UTIL */
 
-#if GRUB_CPU_SIZEOF_VOID_P != GRUB_CPU_SIZEOF_LONG
-# error "This architecture is not supported because sizeof(void *) != sizeof(long)"
-#endif
-
 #if GRUB_CPU_SIZEOF_VOID_P != 4 && GRUB_CPU_SIZEOF_VOID_P != 8
 # error "This architecture is not supported because sizeof(void *) != 4 and sizeof(void *) != 8"
 #endif
 
+#if GRUB_CPU_SIZEOF_LONG != 4 && GRUB_CPU_SIZEOF_LONG != 8
+# error "This architecture is not supported because sizeof(long) != 4 and sizeof(long) != 8"
+#endif
+
 #if !defined (GRUB_UTIL) && !defined (GRUB_TARGET_WORDSIZE)
 # if GRUB_TARGET_SIZEOF_VOID_P == 4
 #  define GRUB_TARGET_WORDSIZE 32