[fpc-devel]Minor differences with Delphi

David Butler david at e.co.za
Fri Nov 7 01:31:42 CET 2003


On Thu, 6 Nov 2003 23:31:27 +0100 (CET), you wrote:

>> * Minor difference with Delphi units: 
>>     * RaiseLastOSError is not defined in SysUtils.
>
>What is it supposed to do, specifically on non windows, or should it
>be windows only? 

I had a look at Kylix's RaiseLastOSError function. It uses
GetLastError which calls '__errno_location' from 'libc.so.6'. On
Windows this uses the GetLastError WinAPI call.

This is Delphi's implementation for RaiseLastOSError:

procedure RaiseLastOSError;
var
  LastError: Integer;
  Error: EOSError;
begin
  LastError := GetLastError;
  if LastError <> 0 then
    Error := EOSError.CreateResFmt(@SOSError, [LastError,
      SysErrorMessage(LastError)])
  else
    Error := EOSError.CreateRes(@SUnkOSError);
  Error.ErrorCode := LastError;
  raise Error;
end;

>>     * variables Win32Platform, Win32MajorVersion, etc. not defined in
>> SysUtils.
>
>Win32platform is already defined. 
>
>I assume the "etc" are Win32MajorVersion, Win32MinorVersion,
>Win32BuildNumber and Win32CSDVersion? Added to windows version of SysUtils
>only (I assumed their contents also originate from getversionex)

Yes, the variables from GetVersionEx.

>Added. (all additions to CVS)

:-)





More information about the fpc-devel mailing list