Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(117)

Unified Diff: third_party/sqlite/src/src/shell_icu_win.c

Issue 694353003: Get `gn gen` to succeed on Windows (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: remove GYP_DEFINES code Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/sqlite/src/src/shell_icu_linux.c ('k') | third_party/sqlite/src/src/sqlite.h.in » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/sqlite/src/src/shell_icu_win.c
diff --git a/third_party/sqlite/src/src/shell_icu_win.c b/third_party/sqlite/src/src/shell_icu_win.c
new file mode 100644
index 0000000000000000000000000000000000000000..67ebbf4fbdb44abf78f155bdb1d9795451c5d2c5
--- /dev/null
+++ b/third_party/sqlite/src/src/shell_icu_win.c
@@ -0,0 +1,32 @@
+/* Copyright 2011 Google Inc. All Rights Reserved.
+**/
+
+#include <windows.h>
+#include "unicode/udata.h"
+
+/*
+** This function attempts to load the ICU data tables from a DLL.
+** Returns 0 on failure, nonzero on success.
+** This a hack job of icu_utils.cc:Initialize(). It's Chrome-specific code.
+*/
+
+#define ICU_DATA_SYMBOL "icudt" U_ICU_VERSION_SHORT "_dat"
+int sqlite_shell_init_icu() {
+ HMODULE module;
+ FARPROC addr;
+ UErrorCode err;
+
+ // Chrome dropped U_ICU_VERSION_SHORT from the icu data dll name.
+ module = LoadLibrary(L"icudt.dll");
+ if (!module)
+ return 0;
+
+ addr = GetProcAddress(module, ICU_DATA_SYMBOL);
+ if (!addr)
+ return 0;
+
+ err = U_ZERO_ERROR;
+ udata_setCommonData(addr, &err);
+
+ return 1;
+}
« no previous file with comments | « third_party/sqlite/src/src/shell_icu_linux.c ('k') | third_party/sqlite/src/src/sqlite.h.in » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698