fpc/tests/webtbs/tw33548.pp
pierre b8cfaeda08 Fix compilation failure for Windows targets
git-svn-id: trunk@38666 -
2018-04-03 09:13:19 +00:00

40 lines
660 B
ObjectPascal
Executable File

program app_test_core;
{$H+}
{$inline on}
{$IFDEF MSWINDOWS}
{$APPTYPE CONSOLE}
{$ENDIF !MSWINDOWS}
uses
Classes, SysUtils;
const
EMPTY_STRING: Char = #0;
function StrToPChar(const Value: string): PChar; inline;
begin
if Pointer(Value) <> nil then
StrToPChar := Pointer(Value)
else
StrToPChar := @EMPTY_STRING;
end;
procedure LogTextA(const TextPtr: PChar; const TextLen: Integer);
var
T: string;
begin
SetString(T, TextPtr, TextLen);
writeln('"', T, '"');
end;
procedure LogTextB(const Text: string); inline;
begin
LogTextA(StrToPChar(Text), Length(Text));
end;
begin
LogTextB('');
end.