don't bother defining ArrayElementSizeOf<type> if it has no array elements

This commit is contained in:
Joel Dice 2008-04-21 16:32:33 -06:00
parent 24d0ea0d9b
commit 864e079aca

View File

@ -1793,11 +1793,14 @@ writeSizes(Output* out, Object* declarations)
out->write(typeFixedSize(o));
out->write(";\n\n");
out->write("const unsigned ArrayElementSizeOf");
out->write(capitalize(typeName(o)));
out->write(" = ");
out->write(typeArrayElementSize(o));
out->write(";\n\n");
int aes = typeArrayElementSize(o);
if (aes) {
out->write("const unsigned ArrayElementSizeOf");
out->write(capitalize(typeName(o)));
out->write(" = ");
out->write(aes);
out->write(";\n\n");
}
} break;
default: break;