]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
cygwin emu build fixes
authorBVK Chaitanya <bvk.groups@gmail.com>
Thu, 6 May 2010 03:15:39 +0000 (08:45 +0530)
committerBVK Chaitanya <bvk.groups@gmail.com>
Thu, 6 May 2010 03:15:39 +0000 (08:45 +0530)
bus/usb/emu/usb.c
conf/any-emu.rmk
include/grub/emu/misc.h
kern/emu/getroot.c
kern/emu/misc.c
util/misc.c

index a687eea9b0581e7cc7d88e2347315052d2153a7c..187857b5b13784828bb938d3e7123be5f563b198 100644 (file)
@@ -105,14 +105,14 @@ grub_usb_root_hub (grub_usb_controller_t controller __attribute__((unused)))
 grub_usb_err_t
 grub_usb_control_msg (grub_usb_device_t dev, grub_uint8_t reqtype,
                      grub_uint8_t request, grub_uint16_t value,
-                     grub_uint16_t index, grub_size_t size, char *data)
+                     grub_uint16_t idx, grub_size_t size, char *data)
 {
   usb_dev_handle *devh;
   struct usb_device *d = dev->data;
 
   devh = usb_open (d);
   if (usb_control_msg (devh, reqtype, request,
-                      value, index, data, size, 20) < 0)
+                      value, idx, data, size, 20) < 0)
     {
       usb_close (devh);
       return GRUB_USB_ERR_STALL;
index cb0ec873fbdeedbef07e04efad7c8361d9d6a2e8..3f0df06aa1706dad6444388e12f2ae732936cf27 100644 (file)
@@ -16,7 +16,7 @@ kernel_img_SOURCES = kern/device.c kern/disk.c kern/dl.c kern/env.c   \
                                                                        \
        gnulib/progname.c disk/host.c
 kernel_img_HEADERS += datetime.h emu/misc.h
-kernel_img_CFLAGS = $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) -Wno-undef -I$(srcdir)/gnulib
+kernel_img_CFLAGS = $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) -Wno-char-subscripts -Wno-unused -Wno-deprecated-declarations -Wno-undef -I$(srcdir)/gnulib
 kernel_img_LDFLAGS = $(COMMON_LDFLAGS)
 TARGET_NO_STRIP = yes
 
index 146e64aa9c2b9f8a833effae944810d137d98128..e037e6be73508e4e642ede3dc606ef17b88e2d67 100644 (file)
@@ -4,6 +4,13 @@
 #include <grub/symbol.h>
 #include <grub/types.h>
 
+#ifdef __CYGWIN__
+# include <sys/fcntl.h>
+# include <sys/cygwin.h>
+# include <limits.h>
+# define DEV_CYGDRIVE_MAJOR 98
+#endif
+
 #ifdef __NetBSD__
 /* NetBSD uses /boot for its boot block.  */
 # define DEFAULT_DIRECTORY     "/grub"
index 10a65aa87e8961759f922495b354742649b4ce08..6875044dae6a0c39a7014f51467bb0e8c792ca51 100644 (file)
@@ -19,6 +19,8 @@
 
 #include <config.h>
 #include <sys/stat.h>
+#include <sys/types.h>
+#include <fcntl.h>
 #include <unistd.h>
 #include <string.h>
 #include <dirent.h>
 #include <stdlib.h>
 #include <stdint.h>
 
-#ifdef __CYGWIN__
-# include <sys/fcntl.h>
-# include <sys/cygwin.h>
-# include <limits.h>
-# define DEV_CYGDRIVE_MAJOR 98
-#endif
-
 #ifdef __GNU__
 #include <hurd.h>
 #include <hurd/lookup.h>
index 56195a851335f7144927b56dbfbe30b18dd4f1fd..4888f4a6b100d4bb0f16addec4079a5fc47484d8 100644 (file)
@@ -176,6 +176,26 @@ grub_get_rtc (void)
             * GRUB_TICKS_PER_SECOND / 1000000));
 }
 
+#ifdef __CYGWIN__
+/* Convert POSIX path to Win32 path,
+   remove drive letter, replace backslashes.  */
+static char *
+get_win32_path (const char *path)
+{
+  char winpath[PATH_MAX];
+  if (cygwin_conv_path (CCP_POSIX_TO_WIN_A, path, winpath, sizeof(winpath)))
+    grub_util_error ("cygwin_conv_path() failed");
+
+  int len = strlen (winpath);
+  int offs = (len > 2 && winpath[1] == ':' ? 2 : 0);
+
+  int i;
+  for (i = offs; i < len; i++)
+    if (winpath[i] == '\\')
+      winpath[i] = '/';
+  return xstrdup (winpath + offs);
+}
+#endif
 
 /* This function never prints trailing slashes (so that its output
    can be appended a slash unconditionally).  */
index 1656d6b5bf50ffad4af63c30aed8d43cb10bde7c..6785eb00f08c6bbf87489478b6d1ba9d3dd2ba43 100644 (file)
 # include <malloc.h>
 #endif
 
-#ifdef __CYGWIN__
-# include <sys/cygwin.h>
-# define DEV_CYGDRIVE_MAJOR 98
-#endif
-
 #ifdef __MINGW32__
 #include <windows.h>
 #include <winioctl.h>
@@ -304,27 +299,6 @@ canonicalize_file_name (const char *path)
   return ret;
 }
 
-#ifdef __CYGWIN__
-/* Convert POSIX path to Win32 path,
-   remove drive letter, replace backslashes.  */
-static char *
-get_win32_path (const char *path)
-{
-  char winpath[PATH_MAX];
-  if (cygwin_conv_path (CCP_POSIX_TO_WIN_A, path, winpath, sizeof(winpath)))
-    grub_util_error ("cygwin_conv_path() failed");
-
-  int len = strlen (winpath);
-  int offs = (len > 2 && winpath[1] == ':' ? 2 : 0);
-
-  int i;
-  for (i = offs; i < len; i++)
-    if (winpath[i] == '\\')
-      winpath[i] = '/';
-  return xstrdup (winpath + offs);
-}
-#endif
-
 #ifdef GRUB_UTIL
 void
 grub_util_init_nls (void)