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

Side by Side Diff: third_party/sqlite/src/src/shell_icu_linux.c

Issue 694353003: Get `gn gen` to succeed on Windows (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: add bison and gperf 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 unified diff | Download patch
OLDNEW
(Empty)
1 /* Copyright 2007 Google Inc. All Rights Reserved.
2 **/
3
4 #include <limits.h>
5 #include <unistd.h>
6 #include "unicode/putil.h"
7 #include "unicode/udata.h"
8
9 /*
10 ** This function attempts to load the ICU data tables from a data file.
11 ** Returns 0 on failure, nonzero on success.
12 ** This a hack job of icu_utils.cc:Initialize(). It's Chrome-specific code.
13 */
14 int sqlite_shell_init_icu() {
15 char bin_dir[PATH_MAX + 1];
16 int bin_dir_size = readlink("/proc/self/exe", bin_dir, PATH_MAX);
17 if (bin_dir_size < 0 || bin_dir_size > PATH_MAX)
18 return 0;
19 bin_dir[bin_dir_size] = 0;;
20
21 u_setDataDirectory(bin_dir);
22 // Only look for the packaged data file;
23 // the default behavior is to look for individual files.
24 UErrorCode err = U_ZERO_ERROR;
25 udata_setFileAccess(UDATA_ONLY_PACKAGES, &err);
26 return err == U_ZERO_ERROR;
27 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698