Parcourir la source

Merged revisions 12290 via svnmerge from
svn+ssh://[email protected]/FPC/svn/fpc/trunk

........
r12290 | sekelsenmat | 2008-12-02 17:01:25 +0100 (Tue, 02 Dec 2008) | 1 line

Fixes gettext crash under Windows CE and adds test case for it.
........

git-svn-id: branches/fixes_2_2@12343 -

joost il y a 17 ans
Parent
commit
a52c009b3d
3 fichiers modifiés avec 12 ajouts et 1 suppressions
  1. 1 0
      .gitattributes
  2. 1 1
      packages/fcl-base/src/gettext.pp
  3. 10 0
      tests/tbs/tb0558.pp

+ 1 - 0
.gitattributes

@@ -6820,6 +6820,7 @@ tests/tbs/tb0544.pp svneol=native#text/plain
 tests/tbs/tb0545.pp svneol=native#text/plain
 tests/tbs/tb0548.pp svneol=native#text/plain
 tests/tbs/tb0553.pp svneol=native#text/plain
+tests/tbs/tb0558.pp svneol=native#text/plain
 tests/tbs/tb205.pp svneol=native#text/plain
 tests/tbs/ub0060.pp svneol=native#text/plain
 tests/tbs/ub0069.pp svneol=native#text/plain

+ 1 - 1
packages/fcl-base/src/gettext.pp

@@ -234,7 +234,7 @@ end;
 {$ifdef windows}
 procedure GetLanguageIDs(var Lang, FallbackLang: string);
 var
-  Buffer: array[1..4] of char;
+  Buffer: array[1..4] of {$ifdef Wince}WideChar{$else}char{$endif};
   Country: string;
   UserLCID: LCID;
 begin

+ 10 - 0
tests/tbs/tb0558.pp

@@ -0,0 +1,10 @@
+{ gettext was crashing under Windows CE. Not crashing should be considered a success }
+
+uses gettext;
+
+var
+  LangDefault, LangFallback: ansistring;
+begin
+  GetLanguageIDs(LangDefault, LangFallback);
+end.
+