diff --git a/harbour/ChangeLog b/harbour/ChangeLog index cdf928aad0..f7f5b5b84e 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,47 @@ past entries belonging to author(s): Viktor Szakats. */ +2009-08-17 17:30 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) + * include/hbsetup.h + % Optimized out HB_OS_UNIX_COMPATIBLE. HB_OS_UNIX should be used + instead. Since the definition logic for HB_OS_UNIX was completely + different from HB_OS_UNIX_COMPATIBLE, it may be possible that + it's not 100% the same as before, although their meaning was + the same. + HB_OS_UNIX_COMPATIBLE is still available for compatibility, but + it's now marked with HB_LEGACY_LEVEL2 and will be removed in next + major release. + + * include/hbapifs.h + * include/hb_io.h + * include/hbsocket.h + * source/vm/set.c + * source/debug/dbgentry.c + * source/common/hbffind.c + * source/rtl/fscopy.c + * source/rtl/fstemp.c + * source/rtl/gtstd/gtstd.c + * source/rtl/gttrm/gttrm.c + * source/rtl/version.c + * source/rtl/hbsocket.c + * source/rtl/copyfile.c + * source/rtl/filesys.c + * source/rtl/console.c + * source/rtl/cputime.c + * source/rtl/gtpca/gtpca.c + * source/rtl/fssize.c + * source/rtl/memofile.c + * source/compiler/hbcomp.c + * source/compiler/gencobj.c + * contrib/hbct/files.c + * contrib/xhb/xhbcopyf.c + * contrib/xhb/hbserv.c + * contrib/hbnf/getenvrn.c + * HB_OS_UNIX_COMPATIBLE -> HB_OS_UNIX + + * config/global.cf + * HB_UNIX_COMPATIBLE -> HB_OS_UNIX + 2009-08-17 16:50 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/include/hbdefs.h ! fixed typo in HB_SWAP_UINT64() macro diff --git a/harbour/config/global.cf b/harbour/config/global.cf index 9065ca289b..df623a4348 100644 --- a/harbour/config/global.cf +++ b/harbour/config/global.cf @@ -308,6 +308,7 @@ else else ifneq ($(OS2_SHELL),) HB_SHELL := os2 + SHELL := $(COMSPEC) else ifneq ($(ComSpec),) COMSPEC := $(ComSpec) @@ -651,9 +652,9 @@ ifeq ($(HB_BUILD_VERBOSE),yes) endif ifneq ($(findstring $(HB_ARCHITECTURE),win wce dos os2),) - HB_UNIX_COMPATIBLE := no + HB_OS_UNIX := no else - HB_UNIX_COMPATIBLE := yes + HB_OS_UNIX := yes endif # Reserve variables for local compiler flags. Makefiles @@ -850,7 +851,7 @@ else # Fill it automatically if not specified ifeq ($(HB_INSTALL_PREFIX),) - ifeq ($(HB_UNIX_COMPATIBLE),no) + ifeq ($(HB_OS_UNIX),no) HB_INSTALL_PREFIX := $(realpath $(TOP)$(ROOT)) else ifneq ($(PREFIX),) @@ -889,7 +890,7 @@ endif ifneq ($(HB_INSTALL_PREFIX),) - ifeq ($(HB_UNIX_COMPATIBLE),no) + ifeq ($(HB_OS_UNIX),no) LIBPOSTFIX := $(DIRSEP)$(subst /,$(DIRSEP),$(ARCH_COMP)) else # Not perfect, please enhance it. @@ -917,7 +918,7 @@ ifneq ($(HB_INSTALL_PREFIX),) endif ifeq ($(HB_DOC_INSTALL),) # Don't set doc dir for *nix targets - ifeq ($(HB_UNIX_COMPATIBLE),no) + ifeq ($(HB_OS_UNIX),no) export HB_DOC_INSTALL := $(HB_INSTALL_PREFIX)$(DIRSEP)doc endif endif diff --git a/harbour/contrib/hbct/files.c b/harbour/contrib/hbct/files.c index c564f5e2a9..56ce43917d 100644 --- a/harbour/contrib/hbct/files.c +++ b/harbour/contrib/hbct/files.c @@ -84,7 +84,7 @@ # include # include #endif -#if defined( HB_OS_UNIX_COMPATIBLE ) || defined( __DJGPP__ ) +#if defined( HB_OS_UNIX ) || defined( __DJGPP__ ) # include # include # include diff --git a/harbour/contrib/hbnf/getenvrn.c b/harbour/contrib/hbnf/getenvrn.c index 2c2a7a6272..59a91ab246 100644 --- a/harbour/contrib/hbnf/getenvrn.c +++ b/harbour/contrib/hbnf/getenvrn.c @@ -94,7 +94,7 @@ #define HB_OS_WIN_USED #include "hbapi.h" -#if defined( HB_OS_UNIX_COMPATIBLE ) +#if defined( HB_OS_UNIX ) # include # if defined( HB_OS_DARWIN ) # include @@ -116,7 +116,7 @@ extern char **_environ; HB_FUNC( FT_GETE ) { -#if defined( HB_OS_DOS ) || defined( HB_OS_UNIX_COMPATIBLE ) +#if defined( HB_OS_DOS ) || defined( HB_OS_UNIX ) { char *buffer = NULL; int x; diff --git a/harbour/contrib/xhb/hbserv.c b/harbour/contrib/xhb/hbserv.c index c5847c13cd..59fa4d564e 100644 --- a/harbour/contrib/xhb/hbserv.c +++ b/harbour/contrib/xhb/hbserv.c @@ -716,7 +716,7 @@ static void hb_service_exit( void* cargo ) static void s_signalHandlersInit() { - #if defined( HB_THREAD_SUPPORT ) && ( defined( HB_OS_UNIX ) || defined( HB_OS_UNIX_COMPATIBLE ) ) + #if defined( HB_THREAD_SUPPORT ) && ( defined( HB_OS_UNIX ) || defined( HB_OS_UNIX ) ) pthread_t res; HB_STACK * pStack; diff --git a/harbour/contrib/xhb/xhbcopyf.c b/harbour/contrib/xhb/xhbcopyf.c index 74b3086682..94493f7c5b 100644 --- a/harbour/contrib/xhb/xhbcopyf.c +++ b/harbour/contrib/xhb/xhbcopyf.c @@ -56,7 +56,7 @@ #include "hbapiitm.h" #include "hbvm.h" -#if defined( HB_OS_UNIX_COMPATIBLE ) +#if defined( HB_OS_UNIX ) #include #include #endif @@ -92,7 +92,7 @@ static BOOL hb_copyfile( const char * szSource, const char * szDest, PHB_ITEM pB if( fhndDest != FS_ERROR ) { -#if defined( HB_OS_UNIX_COMPATIBLE ) +#if defined( HB_OS_UNIX ) struct stat struFileInfo; int iSuccess = fstat( fhndSource, &struFileInfo ); #endif @@ -129,7 +129,7 @@ static BOOL hb_copyfile( const char * szSource, const char * szDest, PHB_ITEM pB hb_xfree( buffer ); -#if defined( HB_OS_UNIX_COMPATIBLE ) +#if defined( HB_OS_UNIX ) if( iSuccess == 0 ) fchmod( fhndDest, struFileInfo.st_mode ); #endif diff --git a/harbour/include/hb_io.h b/harbour/include/hb_io.h index cb0546f8b8..5db7890f5a 100644 --- a/harbour/include/hb_io.h +++ b/harbour/include/hb_io.h @@ -53,7 +53,7 @@ #ifndef HB__IO_H_ #define HB__IO_H_ -#if defined( HB_OS_UNIX_COMPATIBLE ) || \ +#if defined( HB_OS_UNIX ) || \ ( defined( __GNUC__ ) && ! defined( __MINGW32__ ) ) #include #if defined( __DJGPP__ ) || defined( __CYGWIN__ ) || defined( __EMX__ ) diff --git a/harbour/include/hbapifs.h b/harbour/include/hbapifs.h index 7eb49cd529..d230e7158f 100644 --- a/harbour/include/hbapifs.h +++ b/harbour/include/hbapifs.h @@ -215,7 +215,7 @@ extern HB_EXPORT BOOL hb_fsCopy ( const char * pSource, const char #define hb_fsFLock( h, s, l ) hb_fsLock( h, s, l, FL_LOCK ) #define hb_fsFUnlock( h, s, l ) hb_fsLock( h, s, l, FL_UNLOCK ) -#if defined( HB_OS_UNIX_COMPATIBLE ) && !defined( HB_USE_SHARELOCKS_OFF ) +#if defined( HB_OS_UNIX ) && !defined( HB_USE_SHARELOCKS_OFF ) # define HB_USE_SHARELOCKS # define HB_SHARELOCK_POS 0x7fffffffUL # define HB_SHARELOCK_SIZE 0x1UL diff --git a/harbour/include/hbsetup.h b/harbour/include/hbsetup.h index 736a38b88d..98020cfcbd 100644 --- a/harbour/include/hbsetup.h +++ b/harbour/include/hbsetup.h @@ -174,46 +174,12 @@ */ /* #define HB_PP_MULTILINE_STRING */ -/* *********************************************************************** - * Operating system specific definitions - */ -#if ( ( defined( __GNUC__ ) || defined( __SUNPRO_C ) || defined( __SUNPRO_CC ) ) && \ - ! ( defined( __DJGPP__ ) || defined( __EMX__ ) || defined( __RSXNT__ ) || \ - defined( _Windows ) || defined( _WIN32 ) || defined( _WINCE ) ) ) || \ - ( defined( __WATCOMC__ ) && defined( __LINUX__ ) ) - #define HB_OS_UNIX_COMPATIBLE - #define HB_OS_PATH_LIST_SEP_CHR ':' - #define HB_OS_PATH_DELIM_CHR '/' - #define HB_OS_PATH_DELIM_CHR_STRING "/" - #define HB_OS_PATH_DELIM_CHR_LIST "/" - #define HB_OS_ALLFILE_MASK "*" - #undef HB_OS_DRIVE_DELIM_CHR - #undef HB_OS_HAS_DRIVE_LETTER - #define HB_OS_EOL_LEN 1 - #define HB_OS_OPT_DELIM_LIST "-" - #define HB_ISOPTSEP( c ) ( ( c ) == '-' ) -#else - /* we are assuming here the DOS compatible OS */ - #define HB_OS_PATH_LIST_SEP_CHR ';' - #define HB_OS_PATH_DELIM_CHR '\\' - #define HB_OS_PATH_DELIM_CHR_STRING "\\" - #define HB_OS_PATH_DELIM_CHR_LIST "\\/:" - #define HB_OS_ALLFILE_MASK "*.*" - #define HB_OS_DRIVE_DELIM_CHR ':' - #define HB_OS_HAS_DRIVE_LETTER - #define HB_OS_EOL_LEN 2 /* # of bytes in End of Line marker */ - #define HB_OS_OPT_DELIM_LIST "/-" - #define HB_ISOPTSEP( c ) ( ( c ) == '-' || ( c ) == '/' ) -#endif - #ifdef HB_LEGACY_LEVEL2 #ifndef _POSIX_PATH_MAX #define _POSIX_PATH_MAX 255 #endif #endif -#define HB_PATH_MAX 264 /* with trailing 0 byte */ - /* NOTE: Compiler _MSC_VER value -------- -------------- @@ -334,16 +300,49 @@ #endif #ifndef HB_OS_UNIX - #if defined( HB_OS_UNIX_COMPATIBLE ) || \ - defined( HB_OS_LINUX ) || \ + #if defined( HB_OS_LINUX ) || \ defined( HB_OS_DARWIN ) || \ defined( HB_OS_BSD ) || \ defined( HB_OS_SUNOS ) || \ defined( HB_OS_HPUX ) #define HB_OS_UNIX + /* Compatibility. Do not use this. */ + #ifdef HB_LEGACY_LEVEL2 + #define HB_OS_UNIX_COMPATIBLE + #endif #endif #endif +/* *********************************************************************** + * Operating system specific definitions + */ +#if defined( HB_OS_UNIX ) + #define HB_OS_PATH_LIST_SEP_CHR ':' + #define HB_OS_PATH_DELIM_CHR '/' + #define HB_OS_PATH_DELIM_CHR_STRING "/" + #define HB_OS_PATH_DELIM_CHR_LIST "/" + #define HB_OS_ALLFILE_MASK "*" + #undef HB_OS_DRIVE_DELIM_CHR + #undef HB_OS_HAS_DRIVE_LETTER + #define HB_OS_EOL_LEN 1 + #define HB_OS_OPT_DELIM_LIST "-" + #define HB_ISOPTSEP( c ) ( ( c ) == '-' ) +#else + /* we are assuming here the DOS compatible OS */ + #define HB_OS_PATH_LIST_SEP_CHR ';' + #define HB_OS_PATH_DELIM_CHR '\\' + #define HB_OS_PATH_DELIM_CHR_STRING "\\" + #define HB_OS_PATH_DELIM_CHR_LIST "\\/:" + #define HB_OS_ALLFILE_MASK "*.*" + #define HB_OS_DRIVE_DELIM_CHR ':' + #define HB_OS_HAS_DRIVE_LETTER + #define HB_OS_EOL_LEN 2 /* # of bytes in End of Line marker */ + #define HB_OS_OPT_DELIM_LIST "/-" + #define HB_ISOPTSEP( c ) ( ( c ) == '-' || ( c ) == '/' ) +#endif + +#define HB_PATH_MAX 264 /* with trailing 0 byte */ + /* *********************************************************************** * CPU detection */ diff --git a/harbour/include/hbsocket.h b/harbour/include/hbsocket.h index d8f0238b47..59f123ea6d 100644 --- a/harbour/include/hbsocket.h +++ b/harbour/include/hbsocket.h @@ -58,7 +58,7 @@ HB_EXTERN_BEGIN -#if defined( HB_OS_WIN ) && ! defined( HB_OS_UNIX_COMPATIBLE ) +#if defined( HB_OS_WIN ) && ! defined( HB_OS_UNIX ) typedef HB_PTRUINT HB_SOCKET; #else typedef int HB_SOCKET; diff --git a/harbour/source/common/hbffind.c b/harbour/source/common/hbffind.c index ce8cac48f7..2c3e46f147 100644 --- a/harbour/source/common/hbffind.c +++ b/harbour/source/common/hbffind.c @@ -157,7 +157,7 @@ #endif -#if !defined( HB_USE_LARGEFILE64 ) && defined( HB_OS_UNIX_COMPATIBLE ) +#if !defined( HB_USE_LARGEFILE64 ) && defined( HB_OS_UNIX ) #if defined( __USE_LARGEFILE64 ) /* * The macro: __USE_LARGEFILE64 is set when _LARGEFILE64_SOURCE is diff --git a/harbour/source/compiler/gencobj.c b/harbour/source/compiler/gencobj.c index 9a650c4391..6e1b605c41 100644 --- a/harbour/source/compiler/gencobj.c +++ b/harbour/source/compiler/gencobj.c @@ -36,7 +36,7 @@ /* QUESTION: Allocate buffer dynamically ? */ #define HB_CFG_LINE_LEN ( ( HB_PATH_MAX - 1 ) << 1 ) -#if defined( HB_OS_UNIX_COMPATIBLE ) +#if defined( HB_OS_UNIX ) #define HB_NULL_STR " > /dev/null" #else #define HB_NULL_STR " >nul" @@ -135,7 +135,7 @@ void hb_compGenCObj( HB_COMP_DECL, PHB_FNAME pFileName ) char szOutPath[ HB_PATH_MAX ] = "\0"; char pszTemp[ HB_PATH_MAX ] = ""; char buffer[ HB_CFG_LINE_LEN * 2 + 1024 ]; -#if defined( HB_OS_UNIX_COMPATIBLE ) +#if defined( HB_OS_UNIX ) char * pszEnv = hb_strdup( "/etc:/usr/local/etc" ); #else char * pszEnv = hb_getenv( "PATH" ); diff --git a/harbour/source/compiler/hbcomp.c b/harbour/source/compiler/hbcomp.c index 9663ac41a5..b04fcd0f00 100644 --- a/harbour/source/compiler/hbcomp.c +++ b/harbour/source/compiler/hbcomp.c @@ -317,7 +317,7 @@ void hb_compOutStd( HB_COMP_DECL, const char * szMessage ) if( HB_COMP_PARAM->outStdFunc ) HB_COMP_PARAM->outStdFunc( HB_COMP_PARAM->cargo, szMessage ); else -#if defined( HB_OS_UNIX_COMPATIBLE ) +#if defined( HB_OS_UNIX ) fprintf( stdout, "%s", szMessage ); fflush( stdout ); #else fprintf( stderr, "%s", szMessage ); fflush( stderr ); @@ -332,7 +332,7 @@ void hb_compOutErr( HB_COMP_DECL, const char * szMessage ) if( HB_COMP_PARAM->outErrFunc ) HB_COMP_PARAM->outErrFunc( HB_COMP_PARAM->cargo, szMessage ); else -#if defined( HB_OS_UNIX_COMPATIBLE ) +#if defined( HB_OS_UNIX ) fprintf( stderr, "%s", szMessage ); fflush( stderr ); #else fprintf( stdout, "%s", szMessage ); fflush( stdout ); diff --git a/harbour/source/debug/dbgentry.c b/harbour/source/debug/dbgentry.c index c7f8c31189..0b468a3dfa 100644 --- a/harbour/source/debug/dbgentry.c +++ b/harbour/source/debug/dbgentry.c @@ -64,7 +64,7 @@ static BOOL hb_clsSetScope( BOOL fScope ) { return fScope; } #define HB_DBGINFO_DISABLE ( ( HB_DEBUGINFO * ) ( HB_PTRDIFF ) 0x01 ) -#if defined( HB_OS_UNIX_COMPATIBLE ) +#if defined( HB_OS_UNIX ) #define FILENAME_EQUAL(s1, s2) ( !strcmp( (s1), (s2) ) ) #else #define FILENAME_EQUAL(s1, s2) ( !hb_stricmp( (s1), (s2) ) ) diff --git a/harbour/source/rtl/console.c b/harbour/source/rtl/console.c index b41fbaf329..edf6b14600 100644 --- a/harbour/source/rtl/console.c +++ b/harbour/source/rtl/console.c @@ -91,7 +91,7 @@ # define CRLF_BUFFER_LEN HB_OS_EOL_LEN + 1 #endif -#if defined( HB_OS_UNIX_COMPATIBLE ) && !defined( HB_EOL_CRLF ) +#if defined( HB_OS_UNIX ) && !defined( HB_EOL_CRLF ) static const char s_szCrLf[ CRLF_BUFFER_LEN ] = { HB_CHAR_LF, 0 }; static const int s_iCrLfLen = 1; #else diff --git a/harbour/source/rtl/copyfile.c b/harbour/source/rtl/copyfile.c index dc2b585857..8858f57a70 100644 --- a/harbour/source/rtl/copyfile.c +++ b/harbour/source/rtl/copyfile.c @@ -55,7 +55,7 @@ #include "hbapiitm.h" #include "hbapifs.h" -#if defined( HB_OS_UNIX_COMPATIBLE ) +#if defined( HB_OS_UNIX ) #include #include #endif @@ -105,7 +105,7 @@ static BOOL hb_copyfile( const char * szSource, const char * szDest ) if( fhndDest != FS_ERROR ) { -#if defined( HB_OS_UNIX_COMPATIBLE ) +#if defined( HB_OS_UNIX ) struct stat struFileInfo; int iSuccess = fstat( fhndSource, &struFileInfo ); #endif @@ -131,7 +131,7 @@ static BOOL hb_copyfile( const char * szSource, const char * szDest ) hb_xfree( buffer ); -#if defined( HB_OS_UNIX_COMPATIBLE ) +#if defined( HB_OS_UNIX ) if( iSuccess == 0 ) fchmod( fhndDest, struFileInfo.st_mode ); #endif diff --git a/harbour/source/rtl/cputime.c b/harbour/source/rtl/cputime.c index a2f127b751..907705da9f 100644 --- a/harbour/source/rtl/cputime.c +++ b/harbour/source/rtl/cputime.c @@ -58,7 +58,7 @@ #include "hbapi.h" #include "hbdate.h" -#if defined( HB_OS_UNIX_COMPATIBLE ) +#if defined( HB_OS_UNIX ) #include #include #endif @@ -85,7 +85,7 @@ double hb_secondsCPU( int n ) { double d = 0.0; -#if defined( HB_OS_WIN ) && !defined( HB_OS_UNIX_COMPATIBLE ) +#if defined( HB_OS_WIN ) && !defined( HB_OS_UNIX ) FILETIME Create, Exit, Kernel, User; #endif @@ -98,7 +98,7 @@ double hb_secondsCPU( int n ) if( ( n < 1 || n > 3 ) && ( n < 11 || n > 13 ) ) n = 3; -#if defined( HB_OS_UNIX_COMPATIBLE ) +#if defined( HB_OS_UNIX ) { struct tms tm; diff --git a/harbour/source/rtl/filesys.c b/harbour/source/rtl/filesys.c index b9caf50904..a2581fcf6a 100644 --- a/harbour/source/rtl/filesys.c +++ b/harbour/source/rtl/filesys.c @@ -116,7 +116,7 @@ #include "hb_io.h" #include "hbset.h" -#if defined( HB_OS_UNIX_COMPATIBLE ) +#if defined( HB_OS_UNIX ) #include #include #include @@ -202,7 +202,7 @@ #include #endif -#if !defined( HB_USE_LARGEFILE64 ) && defined( HB_OS_UNIX_COMPATIBLE ) +#if !defined( HB_USE_LARGEFILE64 ) && defined( HB_OS_UNIX ) #if defined( __USE_LARGEFILE64 ) /* * The macro: __USE_LARGEFILE64 is set when _LARGEFILE64_SOURCE is @@ -544,7 +544,7 @@ HB_FHANDLE hb_fsPOpen( const char * pFilename, const char * pMode ) HB_TRACE(HB_TR_DEBUG, ("hb_fsPOpen(%p, %s)", pFilename, pMode)); -#if defined( HB_OS_UNIX_COMPATIBLE ) && !defined( __CYGWIN__ ) +#if defined( HB_OS_UNIX ) && !defined( __CYGWIN__ ) { HB_FHANDLE hPipeHandle[2], hNullHandle; pid_t pid; @@ -1181,7 +1181,7 @@ BOOL hb_fsSetFileTime( const char * pszFileName, long lJulian, long lMillisec ) if( pszFree ) hb_xfree( pszFree ); } -#elif defined( HB_OS_UNIX_COMPATIBLE ) || defined( HB_OS_DOS ) +#elif defined( HB_OS_UNIX ) || defined( HB_OS_DOS ) { char * pszFree; @@ -1326,7 +1326,7 @@ BOOL hb_fsSetAttr( const char * pszFileName, ULONG ulAttr ) hb_fsSetIOError( fResult, 0 ); hb_vmLock(); -#elif defined( HB_OS_UNIX_COMPATIBLE ) +#elif defined( HB_OS_UNIX ) { int iAttr = HB_FA_POSIX_ATTR( ulAttr ); if( iAttr == 0 ) @@ -3149,7 +3149,7 @@ BOOL hb_fsEof( HB_FHANDLE hFileHandle ) #if defined( __DJGPP__ ) || defined( __CYGWIN__ ) || \ defined( HB_IO_WIN ) || defined( HB_OS_WIN_CE ) || \ - defined( HB_OS_UNIX_COMPATIBLE ) + defined( HB_OS_UNIX ) { HB_FOFFSET curPos; HB_FOFFSET endPos; diff --git a/harbour/source/rtl/fscopy.c b/harbour/source/rtl/fscopy.c index a088c2ddd2..3c7fc0fc4a 100644 --- a/harbour/source/rtl/fscopy.c +++ b/harbour/source/rtl/fscopy.c @@ -53,7 +53,7 @@ #include "hbapi.h" #include "hbapifs.h" -#if defined( HB_OS_UNIX_COMPATIBLE ) +#if defined( HB_OS_UNIX ) #include #include #endif @@ -70,7 +70,7 @@ BOOL hb_fsCopy( const char * pszSource, const char * pszDest ) { if( ( fhndDest = hb_fsCreate( pszDest, FC_NORMAL ) ) != FS_ERROR ) { -#if defined( HB_OS_UNIX_COMPATIBLE ) +#if defined( HB_OS_UNIX ) struct stat struFileInfo; int iSuccess = fstat( fhndSource, &struFileInfo ); #endif @@ -88,7 +88,7 @@ BOOL hb_fsCopy( const char * pszSource, const char * pszDest ) hb_xfree( pbyBuffer ); -#if defined( HB_OS_UNIX_COMPATIBLE ) +#if defined( HB_OS_UNIX ) if( iSuccess == 0 ) fchmod( fhndDest, struFileInfo.st_mode ); #endif diff --git a/harbour/source/rtl/fssize.c b/harbour/source/rtl/fssize.c index a4d34f97e0..63ddefbe93 100644 --- a/harbour/source/rtl/fssize.c +++ b/harbour/source/rtl/fssize.c @@ -64,7 +64,7 @@ # include #endif -#if !defined( HB_USE_LARGEFILE64 ) && defined( HB_OS_UNIX_COMPATIBLE ) +#if !defined( HB_USE_LARGEFILE64 ) && defined( HB_OS_UNIX ) #if defined( __USE_LARGEFILE64 ) /* * The macro: __USE_LARGEFILE64 is set when _LARGEFILE64_SOURCE is diff --git a/harbour/source/rtl/fstemp.c b/harbour/source/rtl/fstemp.c index 6b39daf2d4..cbf445538f 100644 --- a/harbour/source/rtl/fstemp.c +++ b/harbour/source/rtl/fstemp.c @@ -81,7 +81,7 @@ #endif #endif -#if !defined( HB_USE_LARGEFILE64 ) && defined( HB_OS_UNIX_COMPATIBLE ) +#if !defined( HB_USE_LARGEFILE64 ) && defined( HB_OS_UNIX ) #if defined( __USE_LARGEFILE64 ) /* * The macro: __USE_LARGEFILE64 is set when _LARGEFILE64_SOURCE is diff --git a/harbour/source/rtl/gtpca/gtpca.c b/harbour/source/rtl/gtpca/gtpca.c index 2e6c5ed71e..b328e0cdb5 100644 --- a/harbour/source/rtl/gtpca/gtpca.c +++ b/harbour/source/rtl/gtpca/gtpca.c @@ -70,7 +70,7 @@ #include -#if defined( HB_OS_UNIX_COMPATIBLE ) || defined( __DJGPP__ ) +#if defined( HB_OS_UNIX ) || defined( __DJGPP__ ) #include /* read() function requires it */ #include #include @@ -119,7 +119,7 @@ static int s_iOutBufSize = 0; static int s_iOutBufIndex = 0; static char * s_sOutBuf; -#if defined( HB_OS_UNIX_COMPATIBLE ) || defined( __DJGPP__ ) +#if defined( HB_OS_UNIX ) || defined( __DJGPP__ ) static volatile BOOL s_fRestTTY = FALSE; static struct termios s_saved_TIO, s_curr_TIO; @@ -280,7 +280,7 @@ static void hb_gt_pca_AnsiGetCurPos( int * iRow, int * iCol ) break; else { -#if defined( HB_OS_UNIX_COMPATIBLE ) || defined( __DJGPP__ ) +#if defined( HB_OS_UNIX ) || defined( __DJGPP__ ) struct timeval tv; fd_set rdfds; int iMilliSec; @@ -488,7 +488,7 @@ static void hb_gt_pca_Init( PHB_GT pGT, HB_FHANDLE hFilenoStdin, HB_FHANDLE hFil HB_GTSUPER_INIT( pGT, hFilenoStdin, hFilenoStdout, hFilenoStderr ); /* SA_NOCLDSTOP in #if is a hack to detect POSIX compatible environment */ -#if ( defined( HB_OS_UNIX_COMPATIBLE ) || defined( __DJGPP__ ) ) && \ +#if ( defined( HB_OS_UNIX ) || defined( __DJGPP__ ) ) && \ defined( SA_NOCLDSTOP ) s_fRestTTY = FALSE; if( s_bStdinConsole ) @@ -570,7 +570,7 @@ static void hb_gt_pca_Exit( PHB_GT pGT ) HB_GTSUPER_EXIT( pGT ); -#if defined( HB_OS_UNIX_COMPATIBLE ) || defined( __DJGPP__ ) +#if defined( HB_OS_UNIX ) || defined( __DJGPP__ ) if( s_fRestTTY ) tcsetattr( s_hFilenoStdin, TCSANOW, &s_saved_TIO ); #endif @@ -612,7 +612,7 @@ static int hb_gt_pca_ReadKey( PHB_GT pGT, int iEventMask ) ch = hb_gt_dos_keyCodeTranslate( ch ); if( ch > 0 && ch <= 255 ) ch = s_keyTransTbl[ ch ]; -#elif defined( HB_OS_UNIX_COMPATIBLE ) || defined( __DJGPP__ ) +#elif defined( HB_OS_UNIX ) || defined( __DJGPP__ ) { struct timeval tv; fd_set rfds; @@ -745,7 +745,7 @@ static BOOL hb_gt_pca_Suspend( PHB_GT pGT ) HB_TRACE( HB_TR_DEBUG, ( "hb_gt_pca_Suspend(%p)", pGT ) ); HB_SYMBOL_UNUSED( pGT ); -#if defined( HB_OS_UNIX_COMPATIBLE ) || defined( __DJGPP__ ) +#if defined( HB_OS_UNIX ) || defined( __DJGPP__ ) if( s_fRestTTY ) { tcsetattr( s_hFilenoStdin, TCSANOW, &s_saved_TIO ); @@ -761,7 +761,7 @@ static BOOL hb_gt_pca_Resume( PHB_GT pGT ) HB_TRACE( HB_TR_DEBUG, ( "hb_gt_pca_Resume(%p)", pGT ) ); HB_SYMBOL_UNUSED( pGT ); -#if defined( HB_OS_UNIX_COMPATIBLE ) || defined( __DJGPP__ ) +#if defined( HB_OS_UNIX ) || defined( __DJGPP__ ) if( s_fRestTTY ) { tcsetattr( s_hFilenoStdin, TCSANOW, &s_curr_TIO ); diff --git a/harbour/source/rtl/gtstd/gtstd.c b/harbour/source/rtl/gtstd/gtstd.c index 85e75ee759..abc5203a71 100644 --- a/harbour/source/rtl/gtstd/gtstd.c +++ b/harbour/source/rtl/gtstd/gtstd.c @@ -62,7 +62,7 @@ #include "hbdate.h" #include "hb_io.h" -#if defined( HB_OS_UNIX_COMPATIBLE ) || defined( __DJGPP__ ) +#if defined( HB_OS_UNIX ) || defined( __DJGPP__ ) #include #include #include @@ -113,7 +113,7 @@ typedef struct _HB_GTSTD PHB_CODEPAGE cdpHost; BYTE keyTransTbl[ 256 ]; -#if defined( HB_OS_UNIX_COMPATIBLE ) || defined( __DJGPP__ ) +#if defined( HB_OS_UNIX ) || defined( __DJGPP__ ) struct termios saved_TIO; struct termios curr_TIO; BOOL fRestTTY; @@ -124,7 +124,7 @@ typedef struct _HB_GTSTD } HB_GTSTD, * PHB_GTSTD; -#if defined( HB_OS_UNIX_COMPATIBLE ) || defined( __DJGPP__ ) +#if defined( HB_OS_UNIX ) || defined( __DJGPP__ ) static volatile BOOL s_fRestTTY = FALSE; @@ -227,7 +227,7 @@ static void hb_gt_std_Init( PHB_GT pGT, HB_FHANDLE hFilenoStdin, HB_FHANDLE hFil HB_GTSUPER_INIT( pGT, hFilenoStdin, hFilenoStdout, hFilenoStderr ); /* SA_NOCLDSTOP in #if is a hack to detect POSIX compatible environment */ -#if ( defined( HB_OS_UNIX_COMPATIBLE ) || defined( __DJGPP__ ) ) && \ +#if ( defined( HB_OS_UNIX ) || defined( __DJGPP__ ) ) && \ defined( SA_NOCLDSTOP ) if( pGTSTD->fStdinConsole ) @@ -315,7 +315,7 @@ static void hb_gt_std_Exit( PHB_GT pGT ) while( ++pGTSTD->iRow <= iRow ) hb_gt_std_newLine( pGTSTD ); -#if defined( HB_OS_UNIX_COMPATIBLE ) || defined( __DJGPP__ ) +#if defined( HB_OS_UNIX ) || defined( __DJGPP__ ) if( pGTSTD->fRestTTY ) tcsetattr( pGTSTD->hStdin, TCSANOW, &pGTSTD->saved_TIO ); #endif @@ -338,7 +338,7 @@ static int hb_gt_std_ReadKey( PHB_GT pGT, int iEventMask ) pGTSTD = HB_GTSTD_GET( pGT ); -#if defined( HB_OS_UNIX_COMPATIBLE ) || defined( __DJGPP__ ) +#if defined( HB_OS_UNIX ) || defined( __DJGPP__ ) { struct timeval tv; fd_set rfds; @@ -476,7 +476,7 @@ static BOOL hb_gt_std_Suspend( PHB_GT pGT ) { HB_TRACE( HB_TR_DEBUG, ( "hb_gt_std_Suspend(%p)", pGT ) ); -#if defined( HB_OS_UNIX_COMPATIBLE ) || defined( __DJGPP__ ) +#if defined( HB_OS_UNIX ) || defined( __DJGPP__ ) { PHB_GTSTD pGTSTD = HB_GTSTD_GET( pGT ); if( pGTSTD->fRestTTY ) @@ -492,7 +492,7 @@ static BOOL hb_gt_std_Resume( PHB_GT pGT ) HB_TRACE( HB_TR_DEBUG, ( "hb_gt_std_Resume(%p)", pGT ) ); -#if defined( HB_OS_UNIX_COMPATIBLE ) || defined( __DJGPP__ ) +#if defined( HB_OS_UNIX ) || defined( __DJGPP__ ) { PHB_GTSTD pGTSTD = HB_GTSTD_GET( pGT ); if( pGTSTD->fRestTTY ) diff --git a/harbour/source/rtl/gttrm/gttrm.c b/harbour/source/rtl/gttrm/gttrm.c index 95260df2ac..d7a76899e8 100644 --- a/harbour/source/rtl/gttrm/gttrm.c +++ b/harbour/source/rtl/gttrm/gttrm.c @@ -79,7 +79,7 @@ #include #include -#if defined( HB_OS_UNIX_COMPATIBLE ) || defined( __DJGPP__ ) +#if defined( HB_OS_UNIX ) || defined( __DJGPP__ ) # include # include # include @@ -151,7 +151,7 @@ static HB_GT_FUNCS SuperTable; #define MOUSE_GPM 1 #define MOUSE_XTERM 2 -#if defined( HB_OS_UNIX_COMPATIBLE ) || defined( __DJGPP__ ) +#if defined( HB_OS_UNIX ) || defined( __DJGPP__ ) #define TIMEVAL_GET(tv) gettimeofday(&(tv), NULL) #define TIMEVAL_LESS(tv1, tv2) (((tv1).tv_sec == (tv2).tv_sec ) ? \ @@ -264,7 +264,7 @@ typedef struct { int mbup_row, mbup_col; int mbdn_row, mbdn_col; /* to analize DBLCLK on xterm */ -#if defined( HB_OS_UNIX_COMPATIBLE ) || defined( __DJGPP__ ) +#if defined( HB_OS_UNIX ) || defined( __DJGPP__ ) struct timeval BL_time; struct timeval BR_time; struct timeval BM_time; @@ -342,7 +342,7 @@ typedef struct _HB_GTTRM int terminal_type; int terminal_ext; -#if defined( HB_OS_UNIX_COMPATIBLE ) || defined( __DJGPP__ ) +#if defined( HB_OS_UNIX ) || defined( __DJGPP__ ) struct termios saved_TIO, curr_TIO; BOOL fRestTTY; #endif @@ -391,10 +391,10 @@ typedef struct _HB_GTTRM } HB_TERM_STATE, HB_GTTRM, * PHB_GTTRM; /* static variables use by signal handler */ -#if defined( HB_OS_UNIX_COMPATIBLE ) || defined( __DJGPP__ ) +#if defined( HB_OS_UNIX ) || defined( __DJGPP__ ) static volatile BOOL s_WinSizeChangeFlag = FALSE; #endif -#if defined( HB_OS_UNIX_COMPATIBLE ) && defined( SA_NOCLDSTOP ) +#if defined( HB_OS_UNIX ) && defined( SA_NOCLDSTOP ) static volatile BOOL s_fRestTTY = FALSE; #endif @@ -604,7 +604,7 @@ static int getClipKey( int nKey ) /* SA_NOCLDSTOP in #if is a hack to detect POSIX compatible environment */ -#if defined( HB_OS_UNIX_COMPATIBLE ) && defined( SA_NOCLDSTOP ) +#if defined( HB_OS_UNIX ) && defined( SA_NOCLDSTOP ) static void sig_handler( int iSigNo ) { @@ -663,7 +663,7 @@ static int hb_gt_trm_getSize( PHB_GTTRM pTerm, int * piRows, int * piCols ) { *piRows = *piCols = 0; -#if ( defined( HB_OS_UNIX_COMPATIBLE ) || defined( __DJGPP__ ) ) && \ +#if ( defined( HB_OS_UNIX ) || defined( __DJGPP__ ) ) && \ defined( TIOCGWINSZ ) if( pTerm->fOutTTY ) { @@ -781,7 +781,7 @@ static int add_efds( PHB_GTTRM pTerm, int fd, int mode, if( eventFunc == NULL && mode != O_RDONLY ) return -1; -#if defined( HB_OS_UNIX_COMPATIBLE ) || defined( __DJGPP__ ) +#if defined( HB_OS_UNIX ) || defined( __DJGPP__ ) { int fl; if( ( fl = fcntl( fd, F_GETFL, 0 ) ) == -1 ) @@ -958,7 +958,7 @@ static void chk_mevtdblck( PHB_GTTRM pTerm ) if( newbuttons != 0 ) { -#if defined( HB_OS_UNIX_COMPATIBLE ) || defined( __DJGPP__ ) +#if defined( HB_OS_UNIX ) || defined( __DJGPP__ ) struct timeval tv; #else double tv; @@ -1230,7 +1230,7 @@ static int get_inch( PHB_GTTRM pTerm, int milisec ) { unsigned char buf[STDIN_BUFLEN]; -#if defined( HB_OS_UNIX_COMPATIBLE ) || defined( __DJGPP__ ) +#if defined( HB_OS_UNIX ) || defined( __DJGPP__ ) n = read( pTerm->event_fds[i]->fd, buf, STDIN_BUFLEN - pTerm->stdin_inbuf ); #else @@ -1334,7 +1334,7 @@ static int wait_key( PHB_GTTRM pTerm, int milisec ) int nKey, esc, n, i, ch, counter; keyTab *ptr; -#if defined( HB_OS_UNIX_COMPATIBLE ) || defined( __DJGPP__ ) +#if defined( HB_OS_UNIX ) || defined( __DJGPP__ ) if( s_WinSizeChangeFlag ) { s_WinSizeChangeFlag = FALSE; @@ -1605,7 +1605,7 @@ static BOOL hb_gt_trm_XtermSetMode( PHB_GTTRM pTerm, int * piRows, int * piCols hb_gt_trm_termOut( pTerm, escseq, strlen( escseq ) ); hb_gt_trm_termFlush( pTerm ); -#if defined( HB_OS_UNIX_COMPATIBLE ) || defined( __DJGPP__ ) +#if defined( HB_OS_UNIX ) || defined( __DJGPP__ ) /* dirty hack - wait for SIGWINCH */ if( *piRows != iHeight || *piCols != iWidth ) sleep( 3 ); @@ -1823,7 +1823,7 @@ static BOOL hb_gt_trm_AnsiGetCursorPos( PHB_GTTRM pTerm, int * iRow, int * iCol, break; else { -#if defined( HB_OS_UNIX_COMPATIBLE ) || defined( __DJGPP__ ) +#if defined( HB_OS_UNIX ) || defined( __DJGPP__ ) struct timeval tv; fd_set rdfds; int iMilliSec; @@ -2933,7 +2933,7 @@ static void hb_gt_trm_Init( PHB_GT pGT, HB_FHANDLE hFilenoStdin, HB_FHANDLE hFil hb_gt_trm_SetTerm( pTerm ); /* SA_NOCLDSTOP in #if is a hack to detect POSIX compatible environment */ -#if defined( HB_OS_UNIX_COMPATIBLE ) && defined( SA_NOCLDSTOP ) +#if defined( HB_OS_UNIX ) && defined( SA_NOCLDSTOP ) if( pTerm->fStdinTTY ) { @@ -3029,7 +3029,7 @@ static void hb_gt_trm_Exit( PHB_GT pGT ) if( pTerm ) { -#if defined( HB_OS_UNIX_COMPATIBLE ) || defined( __DJGPP__ ) +#if defined( HB_OS_UNIX ) || defined( __DJGPP__ ) if( pTerm->fRestTTY ) tcsetattr( pTerm->hFilenoStdin, TCSANOW, &pTerm->saved_TIO ); #endif @@ -3195,7 +3195,7 @@ static BOOL hb_gt_trm_Suspend( PHB_GT pGT ) HB_TRACE( HB_TR_DEBUG, ( "hb_gt_trm_Suspend(%p)", pGT ) ); pTerm = HB_GTTRM_GET( pGT ); -#if defined( HB_OS_UNIX_COMPATIBLE ) || defined( __DJGPP__ ) +#if defined( HB_OS_UNIX ) || defined( __DJGPP__ ) if( pTerm->fRestTTY ) tcsetattr( pTerm->hFilenoStdin, TCSANOW, &pTerm->saved_TIO ); #endif @@ -3212,7 +3212,7 @@ static BOOL hb_gt_trm_Resume( PHB_GT pGT ) HB_TRACE( HB_TR_DEBUG, ( "hb_gt_trm_Resume(%p)", pGT ) ); pTerm = HB_GTTRM_GET( pGT ); -#if defined( HB_OS_UNIX_COMPATIBLE ) || defined( __DJGPP__ ) +#if defined( HB_OS_UNIX ) || defined( __DJGPP__ ) if( pTerm->fRestTTY ) tcsetattr( pTerm->hFilenoStdin, TCSANOW, &pTerm->curr_TIO ); #endif diff --git a/harbour/source/rtl/hbsocket.c b/harbour/source/rtl/hbsocket.c index c025008479..b4d1a022a6 100644 --- a/harbour/source/rtl/hbsocket.c +++ b/harbour/source/rtl/hbsocket.c @@ -149,7 +149,7 @@ #endif -#if defined( HB_OS_WIN ) && ! defined( HB_OS_UNIX_COMPATIBLE ) +#if defined( HB_OS_WIN ) && ! defined( HB_OS_UNIX ) # include # include #else diff --git a/harbour/source/rtl/memofile.c b/harbour/source/rtl/memofile.c index 9b556c7ddd..4abf6d896d 100644 --- a/harbour/source/rtl/memofile.c +++ b/harbour/source/rtl/memofile.c @@ -76,7 +76,7 @@ static void hb_memoread( BOOL bHandleEOF ) /* Don't read the file terminating EOF character */ -#if ! defined( HB_OS_UNIX_COMPATIBLE ) +#if ! defined( HB_OS_UNIX ) if( bHandleEOF ) { BYTE byEOF = HB_CHAR_NUL; @@ -138,7 +138,7 @@ static BOOL hb_memowrit( BOOL bHandleEOF ) /* NOTE: CA-Cl*pper will add the EOF even if the write failed. [vszakats] */ /* NOTE: CA-Cl*pper will not return .F. when the EOF could not be written. [vszakats] */ -#if ! defined( HB_OS_UNIX_COMPATIBLE ) +#if ! defined( HB_OS_UNIX ) if( bHandleEOF ) /* if true, then write EOF */ { BYTE byEOF = HB_CHAR_EOF; diff --git a/harbour/source/rtl/version.c b/harbour/source/rtl/version.c index 36fd43a848..332e640557 100644 --- a/harbour/source/rtl/version.c +++ b/harbour/source/rtl/version.c @@ -131,7 +131,7 @@ HB_FUNC( HB_VERSION ) case HB_VERSION_MT: hb_retl( hb_vmIsMt() ); case HB_VERSION_UNIX_COMPAT: - #if defined( HB_OS_UNIX_COMPATIBLE ) + #if defined( HB_OS_UNIX ) hb_retl( TRUE ); #else hb_retl( FALSE ); diff --git a/harbour/source/vm/set.c b/harbour/source/vm/set.c index 49687a2584..5ef44b4990 100644 --- a/harbour/source/vm/set.c +++ b/harbour/source/vm/set.c @@ -272,7 +272,7 @@ static void open_handle( PHB_SET_STRUCT pSet, const char * file_name, if( file_name && file_name[ 0 ] != '\0' ) { /* Create full filename */ -#if defined( HB_OS_UNIX_COMPATIBLE ) +#if defined( HB_OS_UNIX ) bPipe = file_name[ 0 ] == '|'; if( bPipe ) { @@ -1082,7 +1082,7 @@ void hb_setInitialize( PHB_SET_STRUCT pSet ) pSet->HB_SET_DELIMCHARS = hb_strdup( "::" ); pSet->HB_SET_DELIMITERS = FALSE; pSet->HB_SET_DEVICE = hb_strdup( "SCREEN" ); -#if defined( HB_OS_UNIX_COMPATIBLE ) +#if defined( HB_OS_UNIX ) pSet->HB_SET_EOF = FALSE; #else pSet->HB_SET_EOF = TRUE;