* [PATCH] sun is defined macro in solaris derived platforms
@ 2015-04-13 13:23 Toomas Soome
2015-04-13 16:54 ` Andrei Borzenkov
0 siblings, 1 reply; 2+ messages in thread
From: Toomas Soome @ 2015-04-13 13:23 UTC (permalink / raw)
To: The development of GRUB 2
[-- Attachment #1: Type: text/plain, Size: 236 bytes --]
hi!
the symbol “sun” is defined macro in solaris derived systems, from gcc -dM -E:
#define sun 1
and therefore can not be used as name. affected files grub-core/partmap/sun.c and grub-core/partmap/sunpc.c
rgds,
toomas
[-- Attachment #2.1: Type: text/html, Size: 1096 bytes --]
[-- Attachment #2.2: sun.diff --]
[-- Type: application/octet-stream, Size: 2927 bytes --]
diff --git a/grub-core/partmap/sun.c b/grub-core/partmap/sun.c
index dae3602..aac30a3 100644
--- a/grub-core/partmap/sun.c
+++ b/grub-core/partmap/sun.c
@@ -91,7 +91,7 @@ sun_partition_map_iterate (grub_disk_t disk,
struct grub_partition p;
union
{
- struct grub_sun_block sun;
+ struct grub_sun_block sun_block;
grub_uint16_t raw[0];
} block;
int partnum;
@@ -103,7 +103,7 @@ sun_partition_map_iterate (grub_disk_t disk,
if (err)
return err;
- if (GRUB_PARTMAP_SUN_MAGIC != grub_be_to_cpu16 (block.sun.magic))
+ if (GRUB_PARTMAP_SUN_MAGIC != grub_be_to_cpu16 (block.sun_block.magic))
return grub_error (GRUB_ERR_BAD_PART_TABLE, "not a sun partition table");
if (! grub_sun_is_valid (block.raw))
@@ -115,14 +115,14 @@ sun_partition_map_iterate (grub_disk_t disk,
{
struct grub_sun_partition_descriptor *desc;
- if (block.sun.infos[partnum].id == 0
- || block.sun.infos[partnum].id == GRUB_PARTMAP_SUN_WHOLE_DISK_ID)
+ if (block.sun_block.infos[partnum].id == 0
+ || block.sun_block.infos[partnum].id == GRUB_PARTMAP_SUN_WHOLE_DISK_ID)
continue;
- desc = &block.sun.partitions[partnum];
+ desc = &block.sun_block.partitions[partnum];
p.start = ((grub_uint64_t) grub_be_to_cpu32 (desc->start_cylinder)
- * grub_be_to_cpu16 (block.sun.ntrks)
- * grub_be_to_cpu16 (block.sun.nsect));
+ * grub_be_to_cpu16 (block.sun_block.ntrks)
+ * grub_be_to_cpu16 (block.sun_block.nsect));
p.len = grub_be_to_cpu32 (desc->num_sectors);
p.number = p.index = partnum;
if (p.len)
diff --git a/grub-core/partmap/sunpc.c b/grub-core/partmap/sunpc.c
index 442763e..73a430c 100644
--- a/grub-core/partmap/sunpc.c
+++ b/grub-core/partmap/sunpc.c
@@ -74,7 +74,7 @@ sun_pc_partition_map_iterate (grub_disk_t disk,
grub_partition_t p;
union
{
- struct grub_sun_pc_block sun;
+ struct grub_sun_pc_block sun_block;
grub_uint16_t raw[0];
} block;
int partnum;
@@ -92,7 +92,7 @@ sun_pc_partition_map_iterate (grub_disk_t disk,
return err;
}
- if (GRUB_PARTMAP_SUN_PC_MAGIC != grub_le_to_cpu16 (block.sun.magic))
+ if (GRUB_PARTMAP_SUN_PC_MAGIC != grub_le_to_cpu16 (block.sun_block.magic))
{
grub_free (p);
return grub_error (GRUB_ERR_BAD_PART_TABLE,
@@ -111,12 +111,12 @@ sun_pc_partition_map_iterate (grub_disk_t disk,
{
struct grub_sun_pc_partition_descriptor *desc;
- if (block.sun.partitions[partnum].id == 0
- || block.sun.partitions[partnum].id
+ if (block.sun_block.partitions[partnum].id == 0
+ || block.sun_block.partitions[partnum].id
== GRUB_PARTMAP_SUN_PC_WHOLE_DISK_ID)
continue;
- desc = &block.sun.partitions[partnum];
+ desc = &block.sun_block.partitions[partnum];
p->start = grub_le_to_cpu32 (desc->start_sector);
p->len = grub_le_to_cpu32 (desc->num_sectors);
p->number = partnum;
[-- Attachment #2.3: Type: text/html, Size: 233 bytes --]
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-04-13 16:54 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-13 13:23 [PATCH] sun is defined macro in solaris derived platforms Toomas Soome
2015-04-13 16:54 ` Andrei Borzenkov
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.