X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=token.c;h=60adc9df22886f40f35302eb9c3b2ae7060b435b;hb=091c91913c58639a3633b13ec6f8b090da3c7de2;hp=50de6568d10c54fdcbc0b85937dd9526a5089782;hpb=d7384b0b065dd6195ac6649c4d48a06905bc8fe7;p=cparser diff --git a/token.c b/token.c index 50de656..60adc9d 100644 --- a/token.c +++ b/token.c @@ -24,6 +24,7 @@ #include #include +#include #include "symbol.h" #include "lang_features.h" @@ -67,6 +68,11 @@ static void register_pp_token(pp_token_kind_t const id, char const *const string void init_tokens(void) { + static bool tokens_initialized = false; + if (tokens_initialized) + return; + tokens_initialized = true; + memset(token_symbols, 0, T_LAST_TOKEN * sizeof(token_symbols[0])); #define T(mode,x,str,val) register_token(mode, x, str);