From 40e773628923f34e1ee1ec940f80e5efafe57d0e Mon Sep 17 00:00:00 2001 From: Grigory Filatov Date: Fri, 25 Oct 2024 14:10:22 +0200 Subject: [PATCH 1/5] 2024-10-25 14:09 UTC+0200 Aleksander Czajczynski (hb fki.pl) * contrib/hbziparc/ziparc.prg ! return value of hb_zipDeleteFile() is not logical, fix by Grigory Filatov. --- ChangeLog.txt | 5 +++++ contrib/hbziparc/ziparc.prg | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index cc4fb35fb2..8ffc60ffda 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -7,6 +7,11 @@ Entries may not always be in chronological/commit order. See license at the end of file. */ +2024-10-25 14:09 UTC+0200 Aleksander Czajczynski (hb fki.pl) + * contrib/hbziparc/ziparc.prg + ! return value of hb_zipDeleteFile() is not logical, + fix by Grigory Filatov. + 2024-10-18 07:56 UTC+0200 Aleksander Czajczynski (hb fki.pl) * src/common/hbver.c * guard Win10 build number getter from the unknown, diff --git a/contrib/hbziparc/ziparc.prg b/contrib/hbziparc/ziparc.prg index 694e2a6209..c34e082849 100644 --- a/contrib/hbziparc/ziparc.prg +++ b/contrib/hbziparc/ziparc.prg @@ -496,7 +496,7 @@ FUNCTION hb_ZipDeleteFiles( cFileName, acFiles ) ENDIF FOR EACH cFileToProc IN acFiles - lRetVal := lRetVal .AND. hb_zipDeleteFile( cFileName, cFileToProc ) + lRetVal := lRetVal .AND. ( hb_zipDeleteFile( cFileName, cFileToProc ) == UNZ_OK ) NEXT RETURN lRetVal From 4ae51516c204cf90c2e0534ba9bbf656d908e25e Mon Sep 17 00:00:00 2001 From: mdlugosz65 Date: Mon, 28 Oct 2024 16:57:47 +0100 Subject: [PATCH 2/5] 2024-10-28 16:57 UTC+0100 Aleksander Czajczynski (hb fki.pl) * src/rdd/dbf1.c ! reading varchar binary field ("Q:B") from a .dbf could free a wrong pointer in the record buffer. Bug located and fixed by Marek. --- ChangeLog.txt | 6 ++++++ src/rdd/dbf1.c | 10 ++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 8ffc60ffda..802c1e059d 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -7,6 +7,12 @@ Entries may not always be in chronological/commit order. See license at the end of file. */ +2024-10-28 16:57 UTC+0100 Aleksander Czajczynski (hb fki.pl) + * src/rdd/dbf1.c + ! reading varchar binary field ("Q:B") from a .dbf + could free a wrong pointer in the record buffer. + Bug located and fixed by Marek. + 2024-10-25 14:09 UTC+0200 Aleksander Czajczynski (hb fki.pl) * contrib/hbziparc/ziparc.prg ! return value of hb_zipDeleteFile() is not logical, diff --git a/src/rdd/dbf1.c b/src/rdd/dbf1.c index 0c2d3dd0a8..b6d4335f71 100644 --- a/src/rdd/dbf1.c +++ b/src/rdd/dbf1.c @@ -2193,12 +2193,14 @@ static HB_ERRCODE hb_dbfGetValue( DBFAREAP pArea, HB_USHORT uiIndex, PHB_ITEM pI nLen = pField->uiLen; } if( ( pField->uiFlags & HB_FF_BINARY ) == 0 ) + { pszVal = hb_cdpnDup( ( const char * ) pArea->pRecord + pArea->pFieldOffset[ uiIndex ], &nLen, pArea->area.cdPage, hb_vmCDP() ); - else - pszVal = ( char * ) pArea->pRecord + pArea->pFieldOffset[ uiIndex ]; - - hb_itemPutCLPtr( pItem, pszVal, nLen ); + hb_itemPutCLPtr( pItem, pszVal, nLen ); + break; + } + pszVal = ( char * ) pArea->pRecord + pArea->pFieldOffset[ uiIndex ]; + hb_itemPutCL( pItem, pszVal, nLen ); } break; From ccbf3a75ba431d77684e024d5268e26d8171fcca Mon Sep 17 00:00:00 2001 From: Lailton Date: Tue, 3 Dec 2024 01:35:51 -0300 Subject: [PATCH 3/5] 2024-12-03 01:27 UTC-0300 Lailton Fernando Mariano (lailton/at/paysoft.com.br) * src/vm/hashfunc.c ! fixed issue hb_scan when we are looking for a logical value as true. Many thanks to Marcos Gambeta who found the problem. --- ChangeLog.txt | 5 +++++ src/vm/hashfunc.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 802c1e059d..f0d9aac640 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -7,6 +7,11 @@ Entries may not always be in chronological/commit order. See license at the end of file. */ +2024-12-03 01:27 UTC-0300 Lailton Fernando Mariano (lailton/at/paysoft.com.br) + * src/vm/hashfunc.c + ! fixed issue hb_scan when we are looking for a logical value as true. + Many thanks to Marcos Gambeta who found the problem. + 2024-10-28 16:57 UTC+0100 Aleksander Czajczynski (hb fki.pl) * src/rdd/dbf1.c ! reading varchar binary field ("Q:B") from a .dbf diff --git a/src/vm/hashfunc.c b/src/vm/hashfunc.c index 3eb8be76a6..d65ac1db75 100644 --- a/src/vm/hashfunc.c +++ b/src/vm/hashfunc.c @@ -610,7 +610,7 @@ HB_FUNC( HB_HSCAN ) } else if( HB_IS_LOGICAL( pValue ) ) { - HB_BOOL fValue = hb_itemGetDL( pValue ); + HB_BOOL fValue = hb_itemGetL( pValue ); while( nCount-- ) { PHB_ITEM pItem = hb_hashGetValueAt( pHash, nStart ); From b547517db14d1b3d263d9f20a0015465d9e89e26 Mon Sep 17 00:00:00 2001 From: Aleksander Czajczynski Date: Wed, 4 Dec 2024 15:25:32 +0100 Subject: [PATCH 4/5] 2024-12-04 15:25 UTC+0100 Aleksander Czajczynski (hb fki.pl) * src/common/hbver.c ! added lacking VER_BUILDNUMBER definition that is missing in very old compiler sets/SDKs (pre Windows 2000), noticed by DF7BE - Wilfried Brunken in #362 * README.md * slightly updated list of supported compilers and examples to mention MSVC for ARM64 and Clang * ChangeLog.txt * hb_scan -> hb_hscan in prev --- ChangeLog.txt | 15 ++++++++++- README.md | 65 +++++++++++++++++++++++++++++++++++++++++----- src/common/hbver.c | 3 +++ 3 files changed, 75 insertions(+), 8 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index f0d9aac640..00fab45b22 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -7,9 +7,22 @@ Entries may not always be in chronological/commit order. See license at the end of file. */ +2024-12-04 15:25 UTC+0100 Aleksander Czajczynski (hb fki.pl) + * src/common/hbver.c + ! added lacking VER_BUILDNUMBER definition that is missing + in very old compiler sets/SDKs (pre Windows 2000), + noticed by DF7BE - Wilfried Brunken in #362 + + * README.md + * slightly updated list of supported compilers and + examples to mention MSVC for ARM64 and Clang + + * ChangeLog.txt + * hb_scan -> hb_hscan in prev + 2024-12-03 01:27 UTC-0300 Lailton Fernando Mariano (lailton/at/paysoft.com.br) * src/vm/hashfunc.c - ! fixed issue hb_scan when we are looking for a logical value as true. + ! fixed issue hb_hscan when we are looking for a logical value as true. Many thanks to Marcos Gambeta who found the problem. 2024-10-28 16:57 UTC+0100 Aleksander Czajczynski (hb fki.pl) diff --git a/README.md b/README.md index 0574bed8e5..ea3f61a5a9 100644 --- a/README.md +++ b/README.md @@ -1226,6 +1226,53 @@ call "%ProgramFiles(x86)%\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" x86_ia64 win-make ``` +```batchfile +rem MSVC 2022 targeting ARM64 +rem (requires preceding build for native target) +call "%ProgramFiles(x86)%\Microsoft Visual Studio 17.10\BuildTools\VC\Auxiliary\Build\vcvarsall.bat" amd64_arm64 +win-make +``` + +```batchfile +rem Clang distributed by Visual Studio +set PATH="%ProgramFiles(x86)%\Microsoft Visual Studio 17.10\BuildTools\VC\Tools\Llvm\x64\bin";%PATH% +win-make +``` + +```batchfile +rem Clang from winlibs.com +set PATH=C:\winlibs\mingw64\bin;%PATH% +set HB_COMPILER=clang +win-make +``` + +```batchfile +rem Clang x86_64 distributed by MSYS2 from cmd +set PATH=C:\msys64\clang64\bin;%PATH% +win-make +``` + +## on Windows ARM64 hosts + +```batchfile +rem MSVC 2022 for ARM64 +call "%ProgramFiles(x86)%\Microsoft Visual Studio 17.10\BuildTools\VC\Auxiliary\Build\vcvarsall.bat" arm64 +rem set HB_COMPILER=msvcarm64 (may be needed if Clang is also in resulting PATH) +win-make +``` + +```batchfile +rem Clang/MS ARM64 +set PATH=%ProgramFiles%\Microsoft Visual Studio 17.10\BuildTools\VC\Tools\Llvm\ARM64\bin;%PATH% +win-make +``` + +```batchfile +rem Clang/MSYS ARM64 called from cmd +set PATH=C:\msys64\clangarm64\bin;%PATH% +win-make +``` + ## on MS-DOS hosts ```batchfile @@ -1572,15 +1619,16 @@ mailing list. * sunpro - Sun Studio C/C++ ### win -* mingw - MinGW GNU C 3.4.2 and above -* mingw64 - MinGW GNU C x86-64 -* msvc - Microsoft Visual C++ -* msvc64 - Microsoft Visual C++ x86-64 -* msvcia64 - Microsoft Visual C++ IA-64 (Itanium) +* mingw - MinGW GNU C 3.4.2 and above +* mingw64 - MinGW GNU C x86-64 +* msvc - Microsoft Visual C++ +* msvc64 - Microsoft Visual C++ x86-64 +* msvcarm - Microsoft Visual C++ ARM +* msvcarm64 - Microsoft Visual C++ ARM64 +* msvcia64 - Microsoft Visual C++ IA-64 (Itanium) +* clang - Clang (various flavours supported) ### win (partial support, some features may be missing) - -* clang - Clang * watcom - Open Watcom C/C++ * bcc - Borland/CodeGear/Embarcadero C++ 4.x and above * bcc64 - Embarcadero C++ 6.5 and above @@ -1612,6 +1660,7 @@ mailing list. :---- | :------- | :---------------- | :--------------------------------------- | win | win/bcc | x86 | win | win/bcc64 | x86-64 + | win | win/clang | (CPU cross-builds possible: x86, x86-64, arm64) | win | win/gcc | x86 | win | win/global | x86 | win | win/icc | x86 @@ -1621,6 +1670,8 @@ mailing list. | win | win/mingw64 | x86-64 | win | win/msvc | x86 | win | win/msvc64 | x86-64 + | win | win/msvcarm | arm + | win | win/msvcarm64 | arm64 | win | win/msvcia64 | ia64 | win | win/pocc | x86 | win | win/pocc64 | x86-64 diff --git a/src/common/hbver.c b/src/common/hbver.c index 1bd9bb0cd3..79aafccfb3 100644 --- a/src/common/hbver.c +++ b/src/common/hbver.c @@ -86,6 +86,9 @@ #ifndef VER_MAJORVERSION #define VER_MAJORVERSION 0x0000002 #endif + #ifndef VER_BUILDNUMBER + #define VER_BUILDNUMBER 0x0000004 + #endif #ifndef VER_SERVICEPACKMINOR #define VER_SERVICEPACKMINOR 0x0000010 #endif From a9a57985c3f2f045ec017685b7118f0188a5cad6 Mon Sep 17 00:00:00 2001 From: Mario Wan Stadnik Date: Sat, 7 Dec 2024 20:32:29 -0300 Subject: [PATCH 5/5] Update hbmk2.prg Missing feature, can't find windres.exe for MingW64 14.2.0 With this mod it will find it automatically otherwise it will give the resource not find error because it will look for i686-w64-mingw32-windres.exe instead of windres.exe. --- utils/hbmk2/hbmk2.prg | 1 + 1 file changed, 1 insertion(+) diff --git a/utils/hbmk2/hbmk2.prg b/utils/hbmk2/hbmk2.prg index 5146f141fc..a5fb6d8ffe 100644 --- a/utils/hbmk2/hbmk2.prg +++ b/utils/hbmk2/hbmk2.prg @@ -2035,6 +2035,7 @@ STATIC FUNCTION __hbmk( aArgs, nArgTarget, nLevel, /* @ */ lPause, /* @ */ lExit tmp3 := NIL; HB_SYMBOL_UNUSED( tmp3 ) AAdd( aCOMPDET_EMBED, { {| cPrefix | tmp1 := hb_PathNormalize( hb_DirSepAdd( hbmk[ _HBMK_cHB_INSTALL_PFX ] ) + _HBMK_SPECDIR_COMP + hb_ps() + "mingw" + hb_ps() + "bin" ), iif( hb_FileExists( tmp1 + hb_ps() + cPrefix + "gcc" + hbmk[ _HBMK_cCCEXT ] ), tmp1, NIL ) }, "win" , "mingw" , "" , NIL, {| cARCH, cCOMP, cPathBin | hbmk_COMP_Setup( cARCH, cCOMP, cPathBin + hb_ps() + ".." ) } } ) + AAdd( aCOMPDET_EMBED, { {| cPrefix | tmp1 := hb_PathNormalize( hb_DirSepAdd( hbmk[ _HBMK_cHB_INSTALL_PFX ] ) + _HBMK_SPECDIR_COMP + hb_ps() + "mingw64" + hb_ps() + "bin" ), iif( hb_FileExists( tmp1 + hb_ps() + cPrefix + "gcc" + hbmk[ _HBMK_cCCEXT ] ), tmp1, NIL ) }, "win" , "mingw64" , "" , NIL, NIL } ) AAdd( aCOMPDET_EMBED, { {| cPrefix | tmp1 := hb_PathNormalize( hb_DirSepAdd( hbmk[ _HBMK_cHB_INSTALL_PFX ] ) + _HBMK_SPECDIR_COMP + hb_ps() + "mingw64" + hb_ps() + "bin" ), iif( hb_FileExists( tmp1 + hb_ps() + cPrefix + "gcc" + hbmk[ _HBMK_cCCEXT ] ), tmp1, NIL ) }, "win" , "mingw64" , "i686-w64-mingw32-" , NIL, NIL } ) AAdd( aCOMPDET_EMBED, { {| cPrefix | tmp1 := hb_PathNormalize( hb_DirSepAdd( hbmk[ _HBMK_cHB_INSTALL_PFX ] ) + _HBMK_SPECDIR_COMP + hb_ps() + "mingw64" + hb_ps() + "bin" ), iif( hb_FileExists( tmp1 + hb_ps() + cPrefix + "gcc" + hbmk[ _HBMK_cCCEXT ] ), tmp1, NIL ) }, "win" , "mingw64" , "x86_64-w64-mingw32-" , NIL, NIL } ) AAdd( aCOMPDET_EMBED, { {| cPrefix | tmp1 := hb_PathNormalize( hb_DirSepAdd( hbmk[ _HBMK_cHB_INSTALL_PFX ] ) + _HBMK_SPECDIR_COMP + hb_ps() + "mingwarm" + hb_ps() + "bin" ), iif( hb_FileExists( tmp1 + hb_ps() + cPrefix + "gcc" + hbmk[ _HBMK_cCCEXT ] ), tmp1, NIL ) }, "wce" , "mingwarm", "arm-mingw32ce-" , NIL, NIL } )