bugfix: Remove attribute from struct types

GCC does not support some attributes on types:

> warning: ‘visibility’ attribute ignored on types
This commit is contained in:
Jonah Beckford 2023-09-26 20:13:27 -07:00
parent 014d4ea4df
commit edc0d97de0

View file

@ -1126,9 +1126,8 @@ static void define_struct(struct node *n, const char* extattr, const char* extat
str_add(&HDR, s.enums.str, s.enums.len); str_add(&HDR, s.enums.str, s.enums.len);
str_addf(&HDR, "\n%sstruct %s%s%s {\n", str_addf(&HDR, "\n%sstruct %s {\n",
s.decl.len == 0 ? "capnp_nowarn " : "", s.decl.len == 0 ? "capnp_nowarn " : "",
extattr, extattr_space,
n->name.str); n->name.str);
str_add(&HDR, s.decl.str, s.decl.len); str_add(&HDR, s.decl.str, s.decl.len);
str_addf(&HDR, "};\n"); str_addf(&HDR, "};\n");
@ -1662,7 +1661,7 @@ int main() {
str_addf(&HDR, "\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n"); str_addf(&HDR, "\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n");
declare_ext(file_node, "struct %s%s%s;\n", 1, extattr, extattr_space); declare(file_node, "struct %s;\n", 1);
declare(file_node, "typedef struct {capn_ptr p;} %s_ptr;\n", 1); declare(file_node, "typedef struct {capn_ptr p;} %s_ptr;\n", 1);
declare(file_node, "typedef struct {capn_ptr p;} %s_list;\n", 1); declare(file_node, "typedef struct {capn_ptr p;} %s_list;\n", 1);