Browse Source

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

git-svn-id: trunk@8756 -

Jonas Maebe 18 years ago
parent
commit
33c4197f43
3 changed files with 19 additions and 2 deletions
  1. 1 0
      .gitattributes
  2. 3 2
      rtl/inc/system.inc
  3. 15 0
      tests/webtbs/tw9897.pp

+ 1 - 0
.gitattributes

@@ -8477,6 +8477,7 @@ tests/webtbs/tw9766.pp svneol=native#text/plain
 tests/webtbs/tw9827.pp svneol=native#text/plain
 tests/webtbs/tw9894.pp svneol=native#text/plain
 tests/webtbs/tw9894a.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.