diff --git a/KOL.pas b/KOL.pas index 65bd0c5..22d1933 100644 --- a/KOL.pas +++ b/KOL.pas @@ -54042,7 +54042,7 @@ end; var SaveWinVer: Byte = $FF; //[function WinVer] -{$IFDEF nonononoASM_VERSION} +{$IFDEF ASM_VERSION} {$ELSE ASM_VERSION} function WinVer : TWindowsVersion; var MajorVersion, MinorVersion: Byte; diff --git a/KOL_ASM.inc b/KOL_ASM.inc index 1a55dd7..de2b121 100644 --- a/KOL_ASM.inc +++ b/KOL_ASM.inc @@ -17890,7 +17890,7 @@ asm //cmd //opd //@@exit: XCHG EAX, ECX end; -{function WinVer : TWindowsVersion; +function WinVer : TWindowsVersion; asm MOVSX EAX, byte ptr [SaveWinVer] INC AH // если <> 0 после инкремента, то AL содержит вычисленную версию @@ -17900,21 +17900,31 @@ asm XOR EAX, EAX TEST EDX, EDX XCHG DL, DH // DH=MajorVersion; DL=MinorVersion + JL @@platform_9x MOV AL, wvNT - CMP DH, 5 - JB @@save_exit - INC AL // wvY2K - CMP DX, $0501 - JB @@save_exit - INC AL // wvXP - DEC DL + CMP DX, $0400 JZ @@save_exit - INC AL // wvServer2003 - CMP DH, 6 - JB @@save_exit + + INC AL // wvY2K + CMP DX, $0500 + JZ @@save_exit + + INC AL // wvXP + CMP DX, $0501 + JZ @@save_exit + + INC AL // wvWin2003Server + CMP DX, $0502 + JZ @@save_exit + INC AL // wvVista - JMP @@save_exit + CMP DX, $0600 + JZ @@save_exit + + INC AL // wvSeven + CMP DX, $0601 + JZ @@save_exit @@platform_9x: CMP DH, 4 JB @@save_exit // wv31 @@ -17928,7 +17938,7 @@ asm @@save_exit: MOV byte ptr [SaveWinVer], AL @@exit: -end;} +end; //======================================== THE END OF FILE KOL_ASM.inc diff --git a/System/D2006beta/SysInit.pas b/System/D2006beta/SysInit.pas index 3abc531..d511f94 100644 --- a/System/D2006beta/SysInit.pas +++ b/System/D2006beta/SysInit.pas @@ -49,7 +49,7 @@ var { DllProcEx passes the Reserved param provided by WinNT on DLL load & exit } DllProcEx: TDLLProcEx absolute DllProc; DataMark: Integer = 0; { Used to find the virtual base of DATA seg } - CoverageLibraryName: array [0..128] of char = '*'; { initialized by the linker! } + CoverageLibraryName: array [0..128] of Char = '*'; { initialized by the linker! } {$IFDEF ELF} TypeImportsTable: array [0..0] of Pointer platform; { VMT and RTTI imports table for exes } _GLOBAL_OFFSET_TABLE_: ARRAY [0..2] OF Cardinal platform; diff --git a/System/D2006beta/System.pas b/System/D2006beta/System.pas index aaa77cd..83608eb 100644 --- a/System/D2006beta/System.pas +++ b/System/D2006beta/System.pas @@ -1251,6 +1251,8 @@ function Ln(const X: Extended): Extended; function ArcTan(const X: Extended): Extended; function Sqrt(const X: Extended): Extended; +{ Procedures and functions that need compiler magic } + procedure _ROUND; procedure _TRUNC; @@ -1616,7 +1618,11 @@ type reVarDispatch, reVarArrayCreate, reVarNotArray, reVarArrayBounds, reAssertionFailed, reExternalException, { not used here; in SysUtils } - reIntfCastError, reSafeCallError); + reIntfCastError, reSafeCallError +{$IFDEF LINUX} + , reQuit, reCodesetConversion +{$ENDIF} + ); {$NODEFINE TRuntimeError} procedure Error(errorCode: TRuntimeError); @@ -2144,7 +2150,7 @@ function _fxstat(Version: Integer; Handle: Integer; var Stat: TStatStruct): Inte function __xstat(Ver: Integer; FileName: PChar; var StatBuffer: TStatStruct): Integer; cdecl; external libc name '__xstat'; - + function _strlen(P: PChar): Integer; cdecl; external libc name 'strlen'; @@ -2249,9 +2255,9 @@ end; type PMemInfo = ^TMemInfo; TMemInfo = packed record - BaseAddress: Pointer; - AllocationBase: Pointer; - AllocationProtect: Longint; + BaseAddress: Pointer; + AllocationBase: Pointer; + AllocationProtect: Longint; RegionSize: Longint; State: Longint; Protect: Longint; @@ -2640,20 +2646,25 @@ end; {$ENDIF} +//// +{$I FastMM.inc} + +const + DelphiMemoryManager: TMemoryManager = ( + GetMem: SysGetMem; + FreeMem: SysFreeMem; + ReallocMem: SysReallocMem); + + HeapMemoryManager: TMemoryManager = ( + GetMem: DfltGetMem; + FreeMem: DfltFreeMem; + ReallocMem: DfltReallocMem); + {X- by default, system memory allocation routines (API calls) are used. To use Inprise's memory manager (Delphi standard) call UseDelphiMemoryManager procedure. } var - MemoryManager: TMemoryManager = ( - GetMem: DfltGetMem; - FreeMem: DfltFreeMem; - ReallocMem: DfltReallocMem); - -const - DelphiMemoryManager: TMemoryManager = ( - GetMem: SysGetMem; - FreeMem: SysFreeMem; - ReallocMem: SysReallocMem); + MemoryManager: TMemoryManager; procedure UseDelphiMemoryManager; begin @@ -19155,7 +19166,6 @@ end; {X} end; initialization - {$IFDEF MSWINDOWS} {$IFDEF USE_PROCESS_HEAP} HeapHandle := GetProcessHeap; @@ -19163,6 +19173,9 @@ initialization HeapHandle := HeapCreate( 0, 0, 0 ); {$ENDIF} {$ENDIF} + SetMemoryManager(HeapMemoryManager); + //UseDelphiMemoryManager; + Install_FastMM; {$IFDEF MSWINDOWS} //{X (initialized statically} FileMode := 2; @@ -19218,5 +19231,4 @@ finalization {X UninitAllocator; - replaced with call to UninitMemoryManager handler. } UninitMemoryManager; {$ENDIF} -end. - +end. \ No newline at end of file diff --git a/whatsnew.txt b/whatsnew.txt index ed5533b..5228ad6 100644 --- a/whatsnew.txt +++ b/whatsnew.txt @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +22.09.09 +------------------------------------------------------------------- +* добавлен асмовый вариант WinVer (MTsvDN) + ------------------------------------------------------------------- 09.09.09 %) -------------------------------------------------------------------