From cb9888c76d61a31125bde2cdca375a50f2538b63 Mon Sep 17 00:00:00 2001 From: Aleksander Czajczynski Date: Tue, 7 Jan 2025 12:24:59 +0100 Subject: [PATCH] 2025-01-07 12:24 UTC+0100 Aleksander Czajczynski (hb fki.pl) * src/common/hbver.c * indent cleanup * src/rtl/filesys.c * src/rtl/fssize.c ! restore dynamic calling of GetFileAttributesEx() on Windows (significant only on very old systems) --- ChangeLog.txt | 9 +++++++++ src/common/hbver.c | 8 ++++---- src/rtl/filesys.c | 2 +- src/rtl/fssize.c | 2 +- 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 6d64d42e11..a86a9e39fa 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -7,6 +7,15 @@ Entries may not always be in chronological/commit order. See license at the end of file. */ +2025-01-07 12:24 UTC+0100 Aleksander Czajczynski (hb fki.pl) + * src/common/hbver.c + * indent cleanup + + * src/rtl/filesys.c + * src/rtl/fssize.c + ! restore dynamic calling of GetFileAttributesEx() on + Windows (significant only on very old systems) + 2025-01-02 14:33 UTC+0100 Aleksander Czajczynski (hb fki.pl) * config/global.mk * config/win/clang-noauto.mk diff --git a/src/common/hbver.c b/src/common/hbver.c index 79aafccfb3..21b89d3903 100644 --- a/src/common/hbver.c +++ b/src/common/hbver.c @@ -734,10 +734,10 @@ char * hb_verPlatform( void ) if( hb_iswin10() && ! s_iWine ) { - /* On Win10+ build number is more significant than Major Minor */ - char szBuild[ 8 ]; - hb_snprintf( szBuild, sizeof( szBuild ), ".%lu", ( DWORD ) s_iWinNT ); - hb_strncat( pszPlatform, szBuild, PLATFORM_BUF_SIZE ); + /* On Win10+ build number is more significant than Major Minor */ + char szBuild[ 8 ]; + hb_snprintf( szBuild, sizeof( szBuild ), ".%lu", ( DWORD ) s_iWinNT ); + hb_strncat( pszPlatform, szBuild, PLATFORM_BUF_SIZE ); } else if( hb_iswin2k() ) { diff --git a/src/rtl/filesys.c b/src/rtl/filesys.c index 19ca494566..3e282663e1 100644 --- a/src/rtl/filesys.c +++ b/src/rtl/filesys.c @@ -1919,7 +1919,7 @@ HB_BOOL hb_fsGetFileTime( const char * pszFileName, long * plJulian, long * plMi memset( &attrex, 0, sizeof( attrex ) ); - if( GetFileAttributesEx( lpFileName, GetFileExInfoStandard, &attrex ) ) + if( s_pGetFileAttributesEx( lpFileName, GetFileExInfoStandard, &attrex ) ) { FILETIME local_ft; SYSTEMTIME st; diff --git a/src/rtl/fssize.c b/src/rtl/fssize.c index 7a234b413e..019a0ae538 100644 --- a/src/rtl/fssize.c +++ b/src/rtl/fssize.c @@ -105,7 +105,7 @@ HB_FOFFSET hb_fsFSize( const char * pszFileName, HB_BOOL bUseDirEntry ) lpFileName = HB_FSNAMECONV( pszFileName, &lpFree ); memset( &attrex, 0, sizeof( attrex ) ); - fResult = GetFileAttributesEx( lpFileName, GetFileExInfoStandard, &attrex ) && + fResult = s_pGetFileAttributesEx( lpFileName, GetFileExInfoStandard, &attrex ) && ( attrex.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY ) == 0; hb_fsSetIOError( fResult, 0 ); if( lpFree )