Răsfoiți Sursa

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

........
r8756 | jonas | 2007-10-09 19:52:25 +0200 (Tue, 09 Oct 2007) | 3 lines

* changed FPC_EMPTYCHAR into a widechar because it's also used for
widestring -> pwidechar conversions (mantis #9897)

........

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

Jonas Maebe 18 ani în urmă
părinte
comite
d2335d2e97
3 a modificat fișierele cu 19 adăugiri și 2 ștergeri
  1. 1 0
      .gitattributes
  2. 3 2
      rtl/inc/system.inc
  3. 15 0
      tests/webtbs/tw9897.pp

+ 1 - 0
.gitattributes

@@ -8413,6 +8413,7 @@ tests/webtbs/tw9385.pp svneol=native#text/plain
 tests/webtbs/tw9667.pp svneol=native#text/plain
 tests/webtbs/tw9695.pp svneol=native#text/plain
 tests/webtbs/tw9704.pp svneol=native#text/plain
+tests/webtbs/tw9897.pp svneol=native#text/plain
 tests/webtbs/ub1873.pp svneol=native#text/plain
 tests/webtbs/ub1883.pp svneol=native#text/plain
 tests/webtbs/uw0555.pp svneol=native#text/plain

+ 3 - 2
rtl/inc/system.inc

@@ -40,9 +40,10 @@ const
 { For Error Handling.}
   ErrorBase : Pointer = nil;
 
-{ Used by the ansistrings and maybe also other things in the future }
+{ Used by the ansi/widestrings and maybe also other things in the future }
 var
-  emptychar : char;public name 'FPC_EMPTYCHAR';
+  { widechar, because also used by widestring -> pwidechar conversions }
+  emptychar : widechar;public name 'FPC_EMPTYCHAR';
   initialstklen : SizeUint;external name '__stklen';
 
 { checks whether the given suggested size for the stack of the current

+ 15 - 0
tests/webtbs/tw9897.pp

@@ -0,0 +1,15 @@
+program widecharbug;
+
+var
+  AText : WideString;
+  AWideChar: PWideChar;
+
+begin
+  AText := '';
+  AWideChar := PWideChar(AText);
+  if PWord(AWideChar)^<>0 then
+    begin
+      writeln(PWord(AWideChar)^);
+     halt(1);
+    end;
+end.