grub-devel.gnu.org archive mirror
 help / color / mirror / Atom feed
From: Andrey Borzenkov <arvidjaar@gmail.com>
To: grub-devel@gnu.org
Subject: [PATCH] rename FILE to avoid conflict with stdio on mingw
Date: Sat, 28 Dec 2013 16:12:46 +0400	[thread overview]
Message-ID: <1388232766-23712-1-git-send-email-arvidjaar@gmail.com> (raw)

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	other threads:[~2013-12-28 12:13 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1388232766-23712-1-git-send-email-arvidjaar@gmail.com \
    --to=arvidjaar@gmail.com \
    --cc=grub-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).