mirror of
https://github.com/steveicarus/iverilog.git
synced 2026-08-28 16:53:45 +02:00
Not all compilers support struct definition inside an anonymous union
The SunPro compiler does not support struct definitions inside an anonymous union. This patch moves the struct definition so that both gcc and SunPro 12.1 compile this without issue.
This commit is contained in:
+8
-7
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2001-2008 Stephen Williams ([email protected])
|
||||
* Copyright (c) 2001-2010 Stephen Williams ([email protected])
|
||||
*
|
||||
* This source code is free software; you can redistribute it
|
||||
* and/or modify it in source code form under the terms of the GNU
|
||||
@@ -73,18 +73,19 @@ char*symbol_table_s::key_strdup_(const char*str)
|
||||
const unsigned leaf_width = 254;
|
||||
const unsigned node_width = 508;
|
||||
|
||||
struct tree_data_ {
|
||||
char*key;
|
||||
symbol_value_t val;
|
||||
};
|
||||
|
||||
struct tree_node_ {
|
||||
bool leaf_flag;
|
||||
unsigned count;
|
||||
struct tree_node_*parent;
|
||||
|
||||
union {
|
||||
struct {
|
||||
char*key;
|
||||
symbol_value_t val;
|
||||
} leaf[leaf_width];
|
||||
|
||||
struct tree_node_*child[node_width];
|
||||
struct tree_data_ leaf[leaf_width];
|
||||
struct tree_node_ *child[node_width];
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user