grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] rename FILE to avoid conflict with stdio on mingw


From: Andrey Borzenkov
Subject: [PATCH] rename FILE to avoid conflict with stdio on mingw
Date: Sat, 28 Dec 2013 16:12:46 +0400

On mingw libintl.h includes stdio.h which causes error due to redefinition of
FILE. Reimplement without enum to make it less likely to conflict with system
headers.

grub-core/commands/macbless.c:40:11: error: 'FILE' redeclared as different kind
of symbol
   { NONE, FILE, DIR } found;
           ^
In file included from c:\mingw\include\libintl.h:314:0,
                 from ./include/grub/i18n.h:33,
                 from ./include/grub/misc.h:27,
                 from ./include/grub/list.h:25,
                 from ./include/grub/command.h:24,
                 from grub-core/commands/macbless.c:20:
c:\mingw\include\stdio.h:145:3: note: previous declaration of 'FILE' was here
 } FILE;
   ^

---
 grub-core/commands/macbless.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/grub-core/commands/macbless.c b/grub-core/commands/macbless.c
index c521083..3f96a7e 100644
--- a/grub-core/commands/macbless.c
+++ b/grub-core/commands/macbless.c
@@ -36,8 +36,8 @@ struct find_node_context
 {
   grub_uint64_t inode_found;
   char *dirname;
-  enum
-  { NONE, FILE, DIR } found;
+  int found;
+  int is_dir;
 };
 
 static int
@@ -53,7 +53,8 @@ find_inode (const char *filename,
           && grub_strcasecmp (ctx->dirname, filename) == 0)))
     {
       ctx->inode_found = info->inode;
-      ctx->found = info->dir ? DIR : FILE;
+      ctx->found = 1;
+      ctx->is_dir = info->dir;
     }
   return 0;
 }
@@ -175,7 +176,7 @@ grub_mac_bless_file (grub_device_t dev, const char 
*path_in, int intel)
   grub_free (path);
 
   return grub_mac_bless_inode (dev, (grub_uint32_t) ctx.inode_found,
-                              (ctx.found == DIR), intel);
+                              ctx.is_dir, intel);
 }
 
 static grub_err_t
-- 
tg: (989af02..) u/mingw/macbless_stdio_file_conflict (depends on: master)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]