From c5c7646b0ffc01d74c6abb5f47bc11f373fea6b9 Mon Sep 17 00:00:00 2001 From: "David G. Holm" Date: Fri, 3 Sep 1999 01:32:21 +0000 Subject: [PATCH] See ChangeLog entry 19990902-21:15 EDT David G. Holm --- harbour/ChangeLog | 14 ++++++++++++++ harbour/source/rtl/filesys.c | 26 +++++++++++++------------- 2 files changed, 27 insertions(+), 13 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 40dd4505e6..a9a73ff3f9 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,3 +1,17 @@ +19990902-21:15 EDT David G. Holm + * source/rtl/filesys.c + ! Added missing semi-colon for line 1842. + * Replaced all calls to getdisk() and setdisk(), which are not very + likely to be POSIX-compliant (they don't exist in the Cygwin or OS/2 + implementations of GCC), with _getdrive() and _chdrive(), which are + not POSIX-compliant either, but at least they exist for OS/2 GCC, + IBM Visual Age C++, Borland C, and Microsoft C. They also exist in + mingw32/direct.h for Cygwin, but that includes dir.h instead of + mingw32/dir.h, so it won't compile with a default Cygwin install, + so I left in the Cygwin exclusion. I also set things up so that only + OS2, DOS, and _Windows compilers will attempt to use these functions, + seeing as how they are unlikely to exist on Unix and Linux. + 19990902-17:30 GMT+1 Victor Szel * tests/working/rtl_test.prg + <=, >=, >, < operator tests added. diff --git a/harbour/source/rtl/filesys.c b/harbour/source/rtl/filesys.c index e3d48686c6..6faeceb250 100644 --- a/harbour/source/rtl/filesys.c +++ b/harbour/source/rtl/filesys.c @@ -770,19 +770,19 @@ USHORT hb_fsChDrv( BYTE nDrive ) { USHORT uiResult; -#if defined(HAVE_POSIX_IO) && ! defined(__CYGWIN__) +#if defined(HAVE_POSIX_IO) && ( defined(OS2) || defined(DOS) || defined(_Windows) ) && ! defined(__CYGWIN__) - USHORT uiSave = getdisk(); + USHORT uiSave = _getdrive(); errno = 0; - uiResult = setdisk( nDrive ); - if( nDrive == getdisk() ) + uiResult = _chdrive( nDrive ); + if( nDrive == _getdrive() ) { s_uiErrorLast = errno; } else { - setdisk( uiSave ); + _chdrive( uiSave ); s_uiErrorLast = FS_ERROR; } @@ -800,10 +800,10 @@ BYTE hb_fsCurDrv( void ) { USHORT uiResult; -#if defined(HAVE_POSIX_IO) && ! defined(__CYGWIN__) +#if defined(HAVE_POSIX_IO) && ( defined(OS2) || defined(DOS) || defined(_Windows) ) && ! defined(__CYGWIN__) errno = 0; - uiResult = getdisk(); + uiResult = _getdrive(); s_uiErrorLast = errno; #else @@ -820,13 +820,13 @@ USHORT hb_fsIsDrv( BYTE nDrive ) { USHORT uiResult; -#if defined(HAVE_POSIX_IO) && ! defined(__CYGWIN__) +#if defined(HAVE_POSIX_IO) && ( defined(OS2) || defined(DOS) || defined(_Windows) ) && ! defined(__CYGWIN__) - USHORT uiSave = getdisk(); + USHORT uiSave = _getdrive(); errno = 0; - setdisk( nDrive ); - if( nDrive == getdisk() ) + _chdrive( nDrive ); + if( nDrive == _getdrive() ) { uiResult = 1; s_uiErrorLast = errno; @@ -834,7 +834,7 @@ USHORT hb_fsIsDrv( BYTE nDrive ) else { uiResult = 0; - setdisk( uiSave ); + _chdrive( uiSave ); s_uiErrorLast = FS_ERROR; } @@ -1159,7 +1159,7 @@ HARBOUR HB_DISKSPACE( void ) while( ( uiResult = _dos_getdiskfree( uiDrive, &disk ) ) != 0 ) { - WORD wResult = hb_errRT_BASE_Ext1( EG_OPEN, 2018, NULL, NULL, 0, EF_CANDEFAULT ) + WORD wResult = hb_errRT_BASE_Ext1( EG_OPEN, 2018, NULL, NULL, 0, EF_CANDEFAULT ); if( wResult == E_DEFAULT || wResult == E_BREAK ) break;