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

Side by Side Diff: source/i18n/ucln_in.cpp

Issue 845603002: Update ICU to 54.1 step 1 (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/icu.git@master
Patch Set: remove unusued directories Created 5 years, 11 months 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
« no previous file with comments | « source/i18n/ucln_in.c ('k') | source/i18n/ucol.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 ****************************************************************************** 2 ******************************************************************************
3 * * 3 * *
4 * Copyright (C) 2001-2009, International Business Machines * 4 * Copyright (C) 2001-2014, International Business Machines *
5 * Corporation and others. All Rights Reserved. * 5 * Corporation and others. All Rights Reserved. *
6 * * 6 * *
7 ****************************************************************************** 7 ******************************************************************************
8 * file name: ucln_in.c 8 * file name: ucln_in.cpp
9 * encoding: US-ASCII 9 * encoding: US-ASCII
10 * tab size: 8 (not used) 10 * tab size: 8 (not used)
11 * indentation:4 11 * indentation:4
12 * 12 *
13 * created on: 2001July05 13 * created on: 2001July05
14 * created by: George Rhoten 14 * created by: George Rhoten
15 */ 15 */
16 16
17 #include "ucln.h" 17 #include "ucln.h"
18 #include "ucln_in.h" 18 #include "ucln_in.h"
19 #include "mutex.h"
19 #include "uassert.h" 20 #include "uassert.h"
20 21
21 /** Auto-client for UCLN_I18N **/ 22 /** Auto-client for UCLN_I18N **/
22 #define UCLN_TYPE UCLN_I18N 23 #define UCLN_TYPE UCLN_I18N
23 #include "ucln_imp.h" 24 #include "ucln_imp.h"
24 25
25 /* Leave this copyright notice here! It needs to go somewhere in this library. * / 26 /* Leave this copyright notice here! It needs to go somewhere in this library. * /
26 static const char copyright[] = U_COPYRIGHT_STRING; 27 static const char copyright[] = U_COPYRIGHT_STRING;
27 28
28 static cleanupFunc *gCleanupFunctions[UCLN_I18N_COUNT]; 29 static cleanupFunc *gCleanupFunctions[UCLN_I18N_COUNT];
29 30
30 static UBool i18n_cleanup(void) 31 static UBool i18n_cleanup(void)
31 { 32 {
32 ECleanupI18NType libType = UCLN_I18N_START; 33 int32_t libType = UCLN_I18N_START;
34 (void)copyright; /* Suppress unused variable warning with clang. */
33 35
34 while (++libType<UCLN_I18N_COUNT) { 36 while (++libType<UCLN_I18N_COUNT) {
35 if (gCleanupFunctions[libType]) 37 if (gCleanupFunctions[libType])
36 { 38 {
37 gCleanupFunctions[libType](); 39 gCleanupFunctions[libType]();
38 gCleanupFunctions[libType] = NULL; 40 gCleanupFunctions[libType] = NULL;
39 } 41 }
40 } 42 }
41 #if !UCLN_NO_AUTO_CLEANUP && (defined(UCLN_AUTO_ATEXIT) || defined(UCLN_AUTO_LOC AL)) 43 #if !UCLN_NO_AUTO_CLEANUP && (defined(UCLN_AUTO_ATEXIT) || defined(UCLN_AUTO_LOC AL))
42 ucln_unRegisterAutomaticCleanup(); 44 ucln_unRegisterAutomaticCleanup();
43 #endif 45 #endif
44 return TRUE; 46 return TRUE;
45 } 47 }
46 48
47 void ucln_i18n_registerCleanup(ECleanupI18NType type, 49 void ucln_i18n_registerCleanup(ECleanupI18NType type,
48 cleanupFunc *func) 50 cleanupFunc *func) {
49 {
50 U_ASSERT(UCLN_I18N_START < type && type < UCLN_I18N_COUNT); 51 U_ASSERT(UCLN_I18N_START < type && type < UCLN_I18N_COUNT);
51 ucln_registerCleanup(UCLN_I18N, i18n_cleanup);
52 if (UCLN_I18N_START < type && type < UCLN_I18N_COUNT)
53 { 52 {
54 gCleanupFunctions[type] = func; 53 icu::Mutex m; // See ticket 10295 for discussion.
54 ucln_registerCleanup(UCLN_I18N, i18n_cleanup);
55 if (UCLN_I18N_START < type && type < UCLN_I18N_COUNT) {
56 gCleanupFunctions[type] = func;
57 }
55 } 58 }
56 #if !UCLN_NO_AUTO_CLEANUP && (defined(UCLN_AUTO_ATEXIT) || defined(UCLN_AUTO_LOC AL)) 59 #if !UCLN_NO_AUTO_CLEANUP && (defined(UCLN_AUTO_ATEXIT) || defined(UCLN_AUTO_LOC AL))
57 ucln_registerAutomaticCleanup(); 60 ucln_registerAutomaticCleanup();
58 #endif 61 #endif
59 } 62 }
60 63
OLDNEW
« no previous file with comments | « source/i18n/ucln_in.c ('k') | source/i18n/ucol.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698