rename FILE to avoid conflict with stdio on mingw
PATCH 1/1 rename FILE to avoid conflict with stdio on mingw
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(-)
grub-core/commands/macbless.c +5 -4
@@ -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
Signature · 1 line
tg: (989af02..) u/mingw/macbless_stdio_file_conflict (depends on: master)