merge r17487 from cpstrnew branch by michael:

* UPdates from inoussa

git-svn-id: trunk@19116 -
This commit is contained in:
paul 2011-09-17 13:43:15 +00:00
parent 6f08c86eb1
commit cf77233a52
8 changed files with 42 additions and 15 deletions

View File

@ -11,7 +11,7 @@ begin
end;
procedure foo;
var a: array[0..5] of char = 'willow';
var a: array[0..5] of ansichar = 'willow';
const b: array[0..2] of WideChar = 'èâà';
begin
assert( verify(a, sizeof(a), [ord('w'), ord('i'), ord('l'), ord('l'), ord('o'), ord('w')]) );
@ -22,12 +22,12 @@ end;
{$endif}
end;
const c: array[0..10] of char = 'rosenberg';
const c: array[0..9] of ansichar = 'rosenberg';
var d: array[0..10] of WideChar = 'ðîçåíáåðã';
z: array[0..1] of WideChar = 'û';
x: array[0..0] of char = 'x';
z: array[0..0] of WideChar = 'û';
x: array[0..0] of ansichar = 'x';
begin
assert( verify(c, sizeof(c), [114, 111, 115, 101, 110, 98, 101, 114, 103, 0, 0]) );
assert( verify(c, sizeof(c), [114, 111, 115, 101, 110, 98, 101, 114, 103, 0]) );
{$ifdef endian_big}
assert( verify(d, sizeof(d), [$04,$40,$04,$3E,$04,$37,$04,$35,$04,$3D,$04,$31,$04,$35,$04,$40,$04,$33,0,0,0,0]) );
{$else}
@ -35,9 +35,9 @@ begin
{$endif}
foo;
{$ifdef endian_big}
assert( verify(z, sizeof(z), [$04,$4B,0,0]) );
assert( verify(z, sizeof(z), [$04,$4B]) );
{$else}
assert( verify(z, sizeof(z), [$4B,$04,0,0]) );
assert( verify(z, sizeof(z), [$4B,$04]) );
{$endif}
assert( verify(x, sizeof(x), [120]) )
end.
end.

View File

@ -2,6 +2,11 @@ program project1;
{$mode objfpc}{$H+}
{$modeswitch nestedprocvars}
uses
{$ifdef unix}
cwstring,
{$endif unix}
SysUtils;
type
TGetSQLTextProc = function() : string is nested;

View File

@ -1,6 +1,11 @@
{ Source provided for Free Pascal Bug Report 2250 }
{ Submitted by "Konstantin Seiler" on 2002-12-04 }
{ e-mail: list@kseiler.de }
uses
{$ifdef unix}
cwstring,
{$endif unix}
SysUtils;
procedure stringbug;
var env:ansistring;
procedure addenv(s:ansistring);

View File

@ -1,4 +1,9 @@
{$mode fpc}
uses
{$ifdef unix}
cwstring,
{$endif unix}
SysUtils;
resourcestring
s = 'OK';

View File

@ -54,10 +54,10 @@ begin
filestream.free;
try
// try
filestream:= tfilestream.create(textfilename,fmopenread);
memstream:= tmemorystream.create;
try
// try
objecttexttobinary(filestream,memstream);
writeln('objecttexttobinary OK');
try
@ -80,19 +80,21 @@ begin
halt(1);
end;
end;
except
{ except
on e: exception do begin
writeln('objecttexttobinary fails: '+e.message);
halt(1);
end;
end;
filestream.free;
} filestream.free;
memstream.free;
except
{
except
writeln('file '+textfilename+' not found.');
halt(1);
end;
test1.free;
} test1.free;
test2.free;
deletefile(textfilename);
end.

View File

@ -6,6 +6,11 @@
program Project1;
{$mode objfpc}{$H+}
uses
{$ifdef unix}
cwstring,
{$endif unix}
SysUtils;
function GotHint_WantNoHint: string;
procedure Add(const s: string);

View File

@ -4,6 +4,11 @@
program Project1;
{$mode objfpc}{$H+}
uses
{$ifdef unix}
cwstring,
{$endif unix}
SysUtils;
resourcestring
s = 'test';

View File

@ -11,7 +11,7 @@ const
c2=widechar('é');
c3=widestring('é');
var
c: char;
c: ansichar;
wc,wc2: widechar;
s,s2,a: ansistring;
w: widestring;