OLD | NEW |
---|---|
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/icu_util.h" | 5 #include "src/icu_util.h" |
6 | 6 |
7 #if defined(_WIN32) | 7 #if defined(_WIN32) |
8 #include <windows.h> | 8 #include <windows.h> |
9 #endif | 9 #endif |
10 | 10 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
43 bool InitializeICUDefaultLocation(const char* exec_path, | 43 bool InitializeICUDefaultLocation(const char* exec_path, |
44 const char* icu_data_file) { | 44 const char* icu_data_file) { |
45 #if !defined(V8_I18N_SUPPORT) | 45 #if !defined(V8_I18N_SUPPORT) |
46 return true; | 46 return true; |
47 #else | 47 #else |
48 #if ICU_UTIL_DATA_IMPL == ICU_UTIL_DATA_FILE | 48 #if ICU_UTIL_DATA_IMPL == ICU_UTIL_DATA_FILE |
49 if (icu_data_file) { | 49 if (icu_data_file) { |
50 return InitializeICU(icu_data_file); | 50 return InitializeICU(icu_data_file); |
51 } | 51 } |
52 char* icu_data_file_default; | 52 char* icu_data_file_default; |
53 #if __BYTE_ORDER == __LITTLE_ENDIAN | |
Michael Achenbach
2016/07/27 08:58:03
nit: Maybe synonym, I don't know, but in other pla
miran.karic
2016/07/27 13:32:15
After including "src/base/build_config.h" this wor
| |
53 RelativePath(&icu_data_file_default, exec_path, "icudtl.dat"); | 54 RelativePath(&icu_data_file_default, exec_path, "icudtl.dat"); |
55 #elif __BYTE_ORDER == __BIG_ENDIAN | |
56 RelativePath(&icu_data_file_default, exec_path, "icudtb.dat"); | |
57 #else | |
58 #error Unknown endianness | |
59 #endif | |
54 bool result = InitializeICU(icu_data_file_default); | 60 bool result = InitializeICU(icu_data_file_default); |
55 free(icu_data_file_default); | 61 free(icu_data_file_default); |
56 return result; | 62 return result; |
57 #else | 63 #else |
58 return InitializeICU(NULL); | 64 return InitializeICU(NULL); |
59 #endif | 65 #endif |
60 #endif | 66 #endif |
61 } | 67 } |
62 | 68 |
63 bool InitializeICU(const char* icu_data_file) { | 69 bool InitializeICU(const char* icu_data_file) { |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
103 | 109 |
104 UErrorCode err = U_ZERO_ERROR; | 110 UErrorCode err = U_ZERO_ERROR; |
105 udata_setCommonData(reinterpret_cast<void*>(g_icu_data_ptr), &err); | 111 udata_setCommonData(reinterpret_cast<void*>(g_icu_data_ptr), &err); |
106 return err == U_ZERO_ERROR; | 112 return err == U_ZERO_ERROR; |
107 #endif | 113 #endif |
108 #endif | 114 #endif |
109 } | 115 } |
110 | 116 |
111 } // namespace internal | 117 } // namespace internal |
112 } // namespace v8 | 118 } // namespace v8 |
OLD | NEW |