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
This commit is contained in:
Viktor Szakats
2009-08-17 15:31:07 +00:00
parent 475657a4d9
commit db5bb770a7
28 changed files with 156 additions and 115 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -84,7 +84,7 @@
# include <sys/farptr.h>
# include <sys/param.h>
#endif
#if defined( HB_OS_UNIX_COMPATIBLE ) || defined( __DJGPP__ )
#if defined( HB_OS_UNIX ) || defined( __DJGPP__ )
# include <sys/types.h>
# include <utime.h>
# include <unistd.h>

View File

@@ -94,7 +94,7 @@
#define HB_OS_WIN_USED
#include "hbapi.h"
#if defined( HB_OS_UNIX_COMPATIBLE )
#if defined( HB_OS_UNIX )
# include <unistd.h>
# if defined( HB_OS_DARWIN )
# include <crt_externs.h>
@@ -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;

View File

@@ -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;

View File

@@ -56,7 +56,7 @@
#include "hbapiitm.h"
#include "hbvm.h"
#if defined( HB_OS_UNIX_COMPATIBLE )
#if defined( HB_OS_UNIX )
#include <sys/stat.h>
#include <unistd.h>
#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

View File

@@ -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 <unistd.h>
#if defined( __DJGPP__ ) || defined( __CYGWIN__ ) || defined( __EMX__ )

View File

@@ -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

View File

@@ -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
*/

View File

@@ -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;

View File

@@ -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

View File

@@ -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" );

View File

@@ -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 );

View File

@@ -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) ) )

View File

@@ -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

View File

@@ -55,7 +55,7 @@
#include "hbapiitm.h"
#include "hbapifs.h"
#if defined( HB_OS_UNIX_COMPATIBLE )
#if defined( HB_OS_UNIX )
#include <sys/stat.h>
#include <unistd.h>
#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

View File

@@ -58,7 +58,7 @@
#include "hbapi.h"
#include "hbdate.h"
#if defined( HB_OS_UNIX_COMPATIBLE )
#if defined( HB_OS_UNIX )
#include <sys/times.h>
#include <unistd.h>
#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;

View File

@@ -116,7 +116,7 @@
#include "hb_io.h"
#include "hbset.h"
#if defined( HB_OS_UNIX_COMPATIBLE )
#if defined( HB_OS_UNIX )
#include <unistd.h>
#include <time.h>
#include <utime.h>
@@ -202,7 +202,7 @@
#include <sys/file.h>
#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;

View File

@@ -53,7 +53,7 @@
#include "hbapi.h"
#include "hbapifs.h"
#if defined( HB_OS_UNIX_COMPATIBLE )
#if defined( HB_OS_UNIX )
#include <sys/stat.h>
#include <unistd.h>
#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

View File

@@ -64,7 +64,7 @@
# include <sys/stat.h>
#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

View File

@@ -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

View File

@@ -70,7 +70,7 @@
#include <string.h>
#if defined( HB_OS_UNIX_COMPATIBLE ) || defined( __DJGPP__ )
#if defined( HB_OS_UNIX ) || defined( __DJGPP__ )
#include <unistd.h> /* read() function requires it */
#include <termios.h>
#include <sys/ioctl.h>
@@ -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 );

View File

@@ -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 <unistd.h>
#include <termios.h>
#include <sys/ioctl.h>
@@ -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 )

View File

@@ -79,7 +79,7 @@
#include <string.h>
#include <fcntl.h>
#if defined( HB_OS_UNIX_COMPATIBLE ) || defined( __DJGPP__ )
#if defined( HB_OS_UNIX ) || defined( __DJGPP__ )
# include <errno.h>
# include <time.h>
# include <unistd.h>
@@ -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

View File

@@ -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 <winsock2.h>
# include <ws2tcpip.h>
#else

View File

@@ -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;

View File

@@ -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 );

View File

@@ -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;