[build] fix static init issue

This commit is contained in:
Timothy Stack 2020-12-10 22:32:01 -08:00
parent 127fb20b28
commit 6b0b3a65dd
3 changed files with 6 additions and 2 deletions

View File

@ -846,8 +846,11 @@ static set<string> SUPPORTED_CONFIG_SCHEMAS = {
"https://lnav.org/schemas/config-v1.schema.json",
};
const char *DEFAULT_FORMAT_SCHEMA =
"https://lnav.org/schemas/format-v1.schema.json";
set<string> SUPPORTED_FORMAT_SCHEMAS = {
"https://lnav.org/schemas/format-v1.schema.json",
DEFAULT_FORMAT_SCHEMA,
};
static int read_id(yajlpp_parse_context *ypc, const unsigned char *str, size_t len)

View File

@ -122,6 +122,7 @@ void reload_config(std::vector<std::string> &errors);
std::string save_config();
extern const char *DEFAULT_FORMAT_SCHEMA;
extern std::set<std::string> SUPPORTED_FORMAT_SCHEMAS;
#endif

View File

@ -742,7 +742,7 @@ struct json_path_container root_format_handler = json_path_container {
.with_obj_provider(ensure_format)
.with_children(format_handlers)
}
.with_schema_id(*SUPPORTED_FORMAT_SCHEMAS.cbegin());
.with_schema_id(DEFAULT_FORMAT_SCHEMA);
static void write_sample_file()
{