mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-16 11:49:22 +02:00
# revisions: 45993,46211,46430
git-svn-id: branches/fixes_3_2@47576 -
This commit is contained in:
parent
299b7fe63c
commit
9163637388
@ -164,7 +164,8 @@ type
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
pthread_mutexattr_t = record
|
pthread_mutexattr_t = record
|
||||||
__mutexkind: cint;
|
__mutexkind: cint32;
|
||||||
|
process_shared: cbool;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
pthread_cond_t = record
|
pthread_cond_t = record
|
||||||
|
@ -38,6 +38,9 @@ end;
|
|||||||
|
|
||||||
function TEncoding.GetAnsiBytes(const S: string): TBytes;
|
function TEncoding.GetAnsiBytes(const S: string): TBytes;
|
||||||
begin
|
begin
|
||||||
|
if S='' then
|
||||||
|
Result := nil
|
||||||
|
else
|
||||||
Result := GetAnsiBytes(S, 1, Length(S));
|
Result := GetAnsiBytes(S, 1, Length(S));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -49,6 +52,9 @@ end;
|
|||||||
|
|
||||||
function TEncoding.GetAnsiString(const Bytes: TBytes): string;
|
function TEncoding.GetAnsiString(const Bytes: TBytes): string;
|
||||||
begin
|
begin
|
||||||
|
if Length(Bytes)=0 then
|
||||||
|
Result := ''
|
||||||
|
else
|
||||||
Result := GetAnsiString(Bytes, 0, Length(Bytes));
|
Result := GetAnsiString(Bytes, 0, Length(Bytes));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -294,6 +300,9 @@ end;
|
|||||||
|
|
||||||
function TEncoding.GetByteCount(const Chars: TUnicodeCharArray): Integer;
|
function TEncoding.GetByteCount(const Chars: TUnicodeCharArray): Integer;
|
||||||
begin
|
begin
|
||||||
|
if Length(Chars)=0 then
|
||||||
|
Result := 0
|
||||||
|
else
|
||||||
Result := GetByteCount(Chars, 0, Length(Chars));
|
Result := GetByteCount(Chars, 0, Length(Chars));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -309,6 +318,9 @@ end;
|
|||||||
|
|
||||||
function TEncoding.GetByteCount(const S: UnicodeString): Integer;
|
function TEncoding.GetByteCount(const S: UnicodeString): Integer;
|
||||||
begin
|
begin
|
||||||
|
if S='' then
|
||||||
|
Result := 0
|
||||||
|
else
|
||||||
Result := GetByteCount(PUnicodeChar(S), Length(S));
|
Result := GetByteCount(PUnicodeChar(S), Length(S));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -324,6 +336,7 @@ end;
|
|||||||
function TEncoding.GetBytes(const Chars: TUnicodeCharArray): TBytes;
|
function TEncoding.GetBytes(const Chars: TUnicodeCharArray): TBytes;
|
||||||
begin
|
begin
|
||||||
SetLength(Result, GetByteCount(Chars));
|
SetLength(Result, GetByteCount(Chars));
|
||||||
|
if Length(Result)>0 then
|
||||||
GetBytes(@Chars[0], Length(Chars), @Result[0], Length(Result));
|
GetBytes(@Chars[0], Length(Chars), @Result[0], Length(Result));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -358,6 +371,7 @@ end;
|
|||||||
function TEncoding.GetBytes(const S: UnicodeString): TBytes;
|
function TEncoding.GetBytes(const S: UnicodeString): TBytes;
|
||||||
begin
|
begin
|
||||||
SetLength(Result, GetByteCount(S));
|
SetLength(Result, GetByteCount(S));
|
||||||
|
if Length(Result)>0 then
|
||||||
GetBytes(@S[1], Length(S), @Result[0], Length(Result));
|
GetBytes(@S[1], Length(S), @Result[0], Length(Result));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -380,6 +394,9 @@ end;
|
|||||||
|
|
||||||
function TEncoding.GetCharCount(const Bytes: TBytes): Integer;
|
function TEncoding.GetCharCount(const Bytes: TBytes): Integer;
|
||||||
begin
|
begin
|
||||||
|
if Length(Bytes)=0 then
|
||||||
|
Result := 0
|
||||||
|
else
|
||||||
Result := GetCharCount(@Bytes[0], Length(Bytes));
|
Result := GetCharCount(@Bytes[0], Length(Bytes));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -394,6 +411,7 @@ end;
|
|||||||
function TEncoding.GetChars(const Bytes: TBytes): TUnicodeCharArray;
|
function TEncoding.GetChars(const Bytes: TBytes): TUnicodeCharArray;
|
||||||
begin
|
begin
|
||||||
SetLength(Result, GetCharCount(Bytes));
|
SetLength(Result, GetCharCount(Bytes));
|
||||||
|
if Length(Result)>0 then
|
||||||
GetChars(@Bytes[0], Length(Bytes), @Result[0], Length(Result));
|
GetChars(@Bytes[0], Length(Bytes), @Result[0], Length(Result));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -443,10 +461,15 @@ end;
|
|||||||
function TEncoding.GetString(const Bytes: TBytes): UnicodeString;
|
function TEncoding.GetString(const Bytes: TBytes): UnicodeString;
|
||||||
var
|
var
|
||||||
Chars: TUnicodeCharArray;
|
Chars: TUnicodeCharArray;
|
||||||
|
begin
|
||||||
|
if Length(Bytes)=0 then
|
||||||
|
Result := ''
|
||||||
|
else
|
||||||
begin
|
begin
|
||||||
Chars := GetChars(Bytes);
|
Chars := GetChars(Bytes);
|
||||||
SetString(Result, PUnicodeChar(Chars), Length(Chars));
|
SetString(Result, PUnicodeChar(Chars), Length(Chars));
|
||||||
end;
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
function TEncoding.GetString(const Bytes: TBytes; ByteIndex, ByteCount: Integer): UnicodeString;
|
function TEncoding.GetString(const Bytes: TBytes; ByteIndex, ByteCount: Integer): UnicodeString;
|
||||||
var
|
var
|
||||||
|
@ -120,10 +120,9 @@ type
|
|||||||
constructor CreateResFmtHelp(ResString: PString; const Args: array of const;
|
constructor CreateResFmtHelp(ResString: PString; const Args: array of const;
|
||||||
AHelpContext: Longint);
|
AHelpContext: Longint);
|
||||||
Function ToString : String; override;
|
Function ToString : String; override;
|
||||||
{ !!!! }
|
|
||||||
property HelpContext : longint read fhelpcontext write fhelpcontext;
|
property HelpContext : longint read fhelpcontext write fhelpcontext;
|
||||||
property Message : string read fmessage write fmessage;
|
property Message : string read fmessage write fmessage;
|
||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
ExceptClass = class of Exception;
|
ExceptClass = class of Exception;
|
||||||
@ -141,7 +140,7 @@ type
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
{ integer math exceptions }
|
{ integer math exceptions }
|
||||||
EInterror = Class(EExternal);
|
EIntError = Class(EExternal);
|
||||||
EDivByZero = Class(EIntError);
|
EDivByZero = Class(EIntError);
|
||||||
ERangeError = Class(EIntError);
|
ERangeError = Class(EIntError);
|
||||||
EIntOverflow = Class(EIntError);
|
EIntOverflow = Class(EIntError);
|
||||||
|
Loading…
Reference in New Issue
Block a user