Browse Source

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

git-svn-id: trunk@12290 -
sekelsenmat 16 years ago
parent
commit
15e597682e
3 changed files with 12 additions and 1 deletions
  1. 1 0
      .gitattributes
  2. 1 1
      packages/fcl-base/src/gettext.pp
  3. 10 0
      tests/tbs/tb0558.pp

+ 1 - 0
.gitattributes

@@ -7131,6 +7131,7 @@ tests/tbs/tb0554.pp svneol=native#text/plain
 tests/tbs/tb0555.pp svneol=native#text/plain
 tests/tbs/tb0556.pp svneol=native#text/plain
 tests/tbs/tb0557.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.
+