mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-10-26 15:11:33 +01:00
* redefine also PPChar and PPPChar depending on the string type mode, resolves #40491
This commit is contained in:
parent
e00ab51185
commit
b2a13077c0
@ -22,6 +22,8 @@ interface
|
|||||||
type
|
type
|
||||||
Char = AnsiChar;
|
Char = AnsiChar;
|
||||||
PChar = PAnsiChar;
|
PChar = PAnsiChar;
|
||||||
|
PPChar = ^PChar;
|
||||||
|
PPPChar = ^PPChar;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
|
|||||||
@ -20,7 +20,8 @@ interface
|
|||||||
type
|
type
|
||||||
Char = widechar;
|
Char = widechar;
|
||||||
PChar = pwidechar;
|
PChar = pwidechar;
|
||||||
|
PPChar = ^PChar;
|
||||||
|
PPPChar = ^PPChar;
|
||||||
|
|
||||||
{$ifdef FPC_HAS_FEATURE_COMMANDARGS}
|
{$ifdef FPC_HAS_FEATURE_COMMANDARGS}
|
||||||
{$ifdef MSWINDOWS}
|
{$ifdef MSWINDOWS}
|
||||||
|
|||||||
17
tests/webtbs/tw40491.pp
Normal file
17
tests/webtbs/tw40491.pp
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
program test;
|
||||||
|
|
||||||
|
{$MODE OBJFPC}
|
||||||
|
{$MODESWITCH UNICODESTRINGS}
|
||||||
|
|
||||||
|
var
|
||||||
|
S: string;
|
||||||
|
pS: PChar;
|
||||||
|
ppS: PPChar;
|
||||||
|
|
||||||
|
begin
|
||||||
|
S := 'test string';
|
||||||
|
pS := @S[1];
|
||||||
|
ppS := @pS;
|
||||||
|
pS := ppS^; // Error: Incompatible types: got "PChar" expected "PWideChar"
|
||||||
|
WriteLn(string(pS));
|
||||||
|
end.
|
||||||
Loading…
Reference in New Issue
Block a user