4 #include "attribute_t.h"
5 #include "write_compoundsizes.h"
7 void write_compoundsizes(FILE *output, const translation_unit_t *unit)
9 for (const entity_t *entity = unit->scope.entities;
10 entity != NULL; entity = entity->base.next) {
11 if (entity->kind != ENTITY_TYPEDEF)
14 type_t *type = skip_typeref(entity->typedefe.type);
15 if (!is_type_compound(type))
18 /* see if we have the required attributes */
19 const compound_t *compound = type->compound.compound;
20 bool had_dllexport = false;
21 const char *string = NULL;
22 for (const attribute_t *attrib = compound->attributes;
23 attrib != NULL; attrib = attrib->next) {
24 if (attrib->kind == ATTRIBUTE_GNU_DLLEXPORT)
26 if (attrib->kind == ATTRIBUTE_GNU_DEPRECATED) {
27 const attribute_argument_t *argument = attrib->a.arguments;
28 assert(argument != NULL && argument->kind == ATTRIBUTE_ARGUMENT_EXPRESSION);
29 const expression_t *expr = argument->v.expression;
30 assert(expr->kind == EXPR_STRING_LITERAL);
31 string = expr->string_literal.value.begin;
35 if (had_dllexport && string != NULL) {
36 fprintf(output, "%s %u\n", string, get_type_size(type));