Simplify declarations of x-macro FLATBUFFERS_TD (#5638)

This commit is contained in:
Vladimir Glavnyy
2019-11-26 03:54:59 +07:00
committed by Wouter van Oortmerssen
parent bcf1bd5c9e
commit 075e8d676b
13 changed files with 102 additions and 110 deletions

View File

@@ -595,15 +595,15 @@ class LuaGenerator : public BaseGenerator {
}
std::string GenTypeBasic(const Type &type) {
static const char *ctypename[] = {
// clang-format off
#define FLATBUFFERS_TD(ENUM, IDLTYPE, \
CTYPE, JTYPE, GTYPE, NTYPE, PTYPE, RTYPE, KTYPE) \
#PTYPE,
FLATBUFFERS_GEN_TYPES(FLATBUFFERS_TD)
#undef FLATBUFFERS_TD
// clang-format on
static const char *ctypename[] = {
#define FLATBUFFERS_TD(ENUM, IDLTYPE, \
CTYPE, JTYPE, GTYPE, NTYPE, PTYPE, ...) \
#PTYPE,
FLATBUFFERS_GEN_TYPES(FLATBUFFERS_TD)
#undef FLATBUFFERS_TD
};
// clang-format on
return ctypename[type.base_type];
}