void EnumDeclaration::toCBuffer(OutBuffer *buf, HdrGenState *hgs) { buf->writestring("enum "); if (ident) { buf->writestring(ident->toChars()); buf->writeByte(' '); } if (memtype) { buf->writestring(": "); memtype->toCBuffer(buf, NULL, hgs); } if (!members) { buf->writeByte(';'); buf->writenl(); return; } buf->writenl(); buf->writeByte('{'); buf->writenl(); buf->level++; for (size_t i = 0; i < members->dim; i++) { EnumMember *em = (*members)[i]->isEnumMember(); if (!em) continue; em->toCBuffer(buf, hgs); buf->writeByte(','); buf->writenl(); } buf->level--; buf->writeByte('}'); buf->writenl(); }
void EnumDeclaration::toCBuffer(OutBuffer *buf, HdrGenState *hgs) { int i; buf->writestring("enum "); if (ident) { buf->writestring(ident->toChars()); buf->writeByte(' '); } if (memtype) { buf->writestring(": "); memtype->toCBuffer(buf, NULL, hgs); } if (!members) { buf->writeByte(';'); buf->writenl(); return; } buf->writenl(); buf->writeByte('{'); buf->writenl(); for (i = 0; i < members->dim; i++) { EnumMember *em = ((Dsymbol *)members->data[i])->isEnumMember(); if (!em) continue; //buf->writestring(" "); em->toCBuffer(buf, hgs); buf->writeByte(','); buf->writenl(); } buf->writeByte('}'); buf->writenl(); }