* [PATCH] rename FILE to avoid conflict with stdio on mingw
@ 2013-12-28 12:12 Andrey Borzenkov
0 siblings, 0 replies; only message in thread
From: Andrey Borzenkov @ 2013-12-28 12:12 UTC (permalink / raw)
To: grub-devel
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)
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2013-12-28 12:13 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-28 12:12 [PATCH] rename FILE to avoid conflict with stdio on mingw Andrey Borzenkov
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).