File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1818#include "tx.h"
1919#include "ini.h"
2020
21- #ifndef SUPPORT_LANG_V1
22- #define SUPPORT_LANG_V1 1
21+ #ifndef SUPPORT_LANG_V2
22+ #define SUPPORT_LANG_V2 0
2323#endif
2424
2525/* String long enough to hold every used string in the code
@@ -105,7 +105,6 @@ static unsigned fix_crlf(char *str)
105105 return len ;
106106}
107107
108- #if SUPPORT_LANG_V1
109108static void ReadLangV1 (FILE * fh )
110109{
111110 struct str_map * lookup = lookupmap ;
@@ -155,8 +154,8 @@ static void ReadLangV1(FILE* fh)
155154 }
156155 table_size = lookup - lookupmap ;
157156}
158- #endif
159157
158+ #if SUPPORT_LANG_V2
160159static void ReadLangV2 (FILE * fh )
161160{
162161 u16 hash ;
@@ -187,6 +186,7 @@ static void ReadLangV2(FILE* fh)
187186 }
188187 table_size = lookup - lookupmap ;
189188}
189+ #endif
190190
191191static int ReadLang (const char * file )
192192{
@@ -199,7 +199,7 @@ static int ReadLang(const char *file)
199199 // first line of langauge name, ignore it
200200 fgets (tempstring , sizeof (tempstring ), fh );
201201
202- #if SUPPORT_LANG_V1
202+ #if SUPPORT_LANG_V2
203203 // Try to detect the version
204204 if (fread (tempstring , 1 , 1 , fh ) == 1 )
205205 {
@@ -212,7 +212,7 @@ static int ReadLang(const char *file)
212212 ReadLangV2 (fh );
213213 }
214214#else
215- CONFIG_ReadLangV2 (fh );
215+ ReadLangV1 (fh );
216216#endif
217217
218218 fclose (fh );
Original file line number Diff line number Diff line change @@ -37,13 +37,9 @@ void TestV1Language(CuTest *t)
3737 fclose (fh );
3838
3939 ReadLang (name );
40- #if SUPPORT_LANG_V1
4140 CuAssertTrue (t , table_size > 0 );
4241 CuAssertTrue (t , lookupmap [0 ].hash < lookupmap [1 ].hash );
4342 CuAssertStrEquals (t , "abcd" , _tr ("test" ));
4443 CuAssertStrEquals (t , "ko" , _tr ("ok" ));
4544 CuAssertStrEquals (t , "ok1" , _tr ("ok1" ));
46- #else
47- CuAssertTrue (t , table_size == 0 );
48- #endif
4945}
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ sub main {
1818 my $elffile ;
1919 my $count ;
2020 my $po ;
21- my $format = " v2 " ;
21+ my $format = " v1 " ;
2222
2323 $ENV {CROSS } ||= " " ;
2424 GetOptions(" update" => \$update , " language=s" => \$lang , " fs=s" => \$fs ,
You can’t perform that action at this time.
0 commit comments