blob: 84a9c2bb1a57441f9867ae3f71324b99cf130c16 [file] [log] [blame]
// Copyright 2019 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// This is a shim that injects Chrome's ICU initialization sequence into
// SQLite's shell. BUILD.gn uses this instead of building the sqlite_shell.c
// file in the amalgamation directly.
#include "third_party/sqlite/sqlite_shell_icu_helper.h"
// On Windows, SQLite's shell.c defines wmain() instead of main() by default.
// This preprocessor macro causes it to use main().
#define SQLITE_SHELL_IS_UTF8 1
// While processing shell.c, rename main() to sqlite_shell_main().
#define main sqlite_shell_main
#include "third_party/sqlite/src/amalgamation/shell/shell.c"
#undef main
int main(int argc, char** argv) {
InitializeICUForSqliteShell();
return sqlite_shell_main(argc, argv);
}