forked from unicode-org/icu-docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathversioning.html
211 lines (175 loc) · 4.92 KB
/
versioning.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="GENERATOR" content="Mozilla/4.72 [en] (Windows NT 5.0; U) [Netscape]">
<title>versioning</title>
</head>
<body>
<blockquote>
<blockquote>
<blockquote>
<blockquote>
<blockquote>
<blockquote>
<blockquote><b><font size=+2>ICU Versioning Design</font></b></blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
<b><font size=+2>Overview</font></b>
<br>The current solution for versioning in ICU using #define causes renaming
of symbol names unrelated to ICU, breaking the clients code.
<p><b><font size=+2>Options</font></b>
<p>The options that were discussed :
<br>
<ul>
<li>
#undef the troublesome symbols in the compilation unit.</li>
<br><b>Cons:</b>
<ul>
<li>
Would not rename the ICU related symbols causing loss of versioning information
after the symbols is undefined.</li>
<li>
The clients application may not link since the symbols are not valid entry
points in the library.</li>
</ul>
</ul>
<ul>
<li>
Use namespaces</li>
<br><b>Pros:</b>
<ul>
<li>
Do not need to rename class names.</li>
</ul>
<p><br><b>Cons:</b>
<ul>
<li>
All C++ compilers may not support namespaces, especially OS390, AS400 and
AIX</li>
<li>
Does not solve the problem if versioning is included in the class name
but will if the namespace includes versioning.</li>
<li>
Current versioning mechanism needs to be changed so that the namespace
includes the version information. e.g.:</li>
</ul>
<ul>/************* namespace.h ********************/
<br>#include <iostream.h>
<br>#include <afx.h>
<p>#define ICU ICU_1_9
<p>namespace ICU{
<br> class Format{
<br> public:
<br>
static void printString(){
<br>
::cout<<"Hello World" <<endl;
<br>
}
<br> };
<p>}
<p>/************** namespace.cpp****************/
<br>#include "namespace.h"
<p>using namespace ICU;
<p>int main(){
<p> Format::printString();
<br> CString str = "adfasdfasdf";
<br> str.Format("afdsfafd");
<br> return 0;
<br>}</ul>
</ul>
<ul>
<li>
Rename all ICU classes to include prefix ICU, e.g.: Format class
will be renamed to ICUFormat</li>
<br><b>Pros:</b>
<ul>
<li>
Do not need to depend on namespace support on different compilers.</li>
<li>
Do not need to change the current versioning mechanism</li>
</ul>
<p><br><b>Cons:</b>
<ul>
<li>
Need to rename all C++ classes</li>
<li>
Test, document and port code on all platforms</li>
<li>
Provide compatibility layer clients using old class names</li>
</ul>
</ul>
<ul>
<li>
Use typedef.</li>
<br><b>Cons:</b>
<ul>
<li>
Requires renaming of class names to include the version. e.g.:</li>
</ul>
class Format{ ..... } ;
<p> is renamed to
<p> class Format_1_9{.......};
<br> typedef Format_1_9 Format;</ul>
<p><br><b><font size=+2>Proposed course of action</font></b>
<p>Check all IBM clients' platforms (OS390, AS400, AIX) and compilers like
<br>GCC, HPUX, CXX, SUN's compilers for namespace support.
<br>
<table BORDER COLS=2 WIDTH="46%" >
<tr>
<td> <b>Support available</b></td>
<td><b>Support not available on certain platforms</b></td>
</tr>
<tr>
<td></td>
<td></td>
</tr>
<tr>
<td>Create namespace for all c++ classe</td>
<td>Rename all C++ classes</td>
</tr>
<tr>
<td>Put c++ rename undef flags if C++</td>
<td>Modify header files and CPP files</td>
</tr>
<tr>
<td>Put namespace in the header </td>
<td>Document and change userguide to reflect changes</td>
</tr>
<tr>
<td> Conduct tests on compiler support</td>
<td>Compile files with #ifdef</td>
</tr>
<tr>
<td></td>
<td></td>
</tr>
</table>
<br>
<p><b><font size=+2>Current course of action</font></b>
<p>After initial investigation on compilers and namespaces it turned out
that AIX does not support namespaces. Since AIX is one of the main
IBM platforms,
<br>namespaces solution cannot be used.
<br>
<table BORDER COLS=1 WIDTH="26%" >
<tr>
<td>Rename all C++ classes</td>
</tr>
<tr>
<td>Modify header files and CPP files</td>
</tr>
<tr>
<td>Document and change userguide to reflect changes</td>
</tr>
<tr>
<td>Compile files with #ifdef</td>
</tr>
</table>
</body>
</html>