From 809a2d4969d824cdd2095b257ba1f84aec84dad0 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sun, 12 Mar 2000 02:40:05 +0000 Subject: [PATCH] 20000312-03:40 GMT+1 Victor Szakats --- harbour/ChangeLog | 18 ++++++++++++++++++ harbour/include/hbdefs.h | 6 +++--- harbour/include/hbinit.h | 6 +++--- harbour/include/hbsetup.h | 2 +- harbour/source/rtl/copyfile.c | 6 +++--- harbour/source/rtl/environ.c | 14 +++++++------- harbour/source/rtl/filesys.c | 6 +++--- harbour/source/rtl/gt/gtdos.c | 14 +++++++------- harbour/source/rtl/inkey.c | 4 ++-- harbour/source/rtl/isprint.c | 6 +++--- harbour/source/rtl/mouse/mousewin.c | 6 ++---- harbour/source/tools/io.c | 20 ++++++++++---------- harbour/source/vm/itemapi.c | 2 +- harbour/source/vm/maindll.c | 2 +- harbour/source/vm/mainwin.c | 2 +- 15 files changed, 65 insertions(+), 49 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 86c8a0554d..09a16d5651 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,3 +1,21 @@ +20000312-03:40 GMT+1 Victor Szakats + * include/hbdefs.h + include/hbinit.h + include/hbsetup.h + source/rtl/gt/gtdos.c + source/rtl/mouse/mousewin.c + source/rtl/copyfile.c + source/rtl/environ.c + source/rtl/filesys.c + source/rtl/inkey.c + source/rtl/isprint.c + source/tools/io.c + source/vm/itemapi.c + source/vm/maindll.c + source/vm/mainwin.c + * Platform/compiler related #ifdef-s changed to #if defined() for easy + GREP. + 20000311-23:00 GMT+3 Alexander Kresin * contrib/rdd_ads/ads1.c * include/hbapirdd.h diff --git a/harbour/include/hbdefs.h b/harbour/include/hbdefs.h index 8f6a75e112..69cc9d6dde 100644 --- a/harbour/include/hbdefs.h +++ b/harbour/include/hbdefs.h @@ -111,15 +111,15 @@ typedef unsigned long ULONG; #define HB_SYMBOL_UNUSED( symbol ) ( void ) symbol -#ifdef __GNUC__ +#if defined(__GNUC__) #define pascal __attribute__ ((stdcall)) #endif -#ifdef _MSC_VER +#if defined(_MSC_VER) #define HARBOUR void #define EXTERNAL_LINKAGE #else - #ifdef __IBMCPP__ + #if defined(__IBMCPP__) #define HARBOUR void #define EXTERNAL_LINKAGE _LNK_CONV #else diff --git a/harbour/include/hbinit.h b/harbour/include/hbinit.h index 50003af6ef..48ca860e22 100644 --- a/harbour/include/hbinit.h +++ b/harbour/include/hbinit.h @@ -54,7 +54,7 @@ extern void hb_vmProcessSymbols( PHB_SYMB pSymbols, USHORT uiSymbols ); /* stati #else /* HARBOUR_STRICT_ANSI_C */ -#ifdef __GNUC__ +#if defined(__GNUC__) #define HB_INIT_SYMBOLS_BEGIN( func ) \ static HB_SYMB symbols[] = { @@ -72,7 +72,7 @@ extern void hb_vmProcessSymbols( PHB_SYMB pSymbols, USHORT uiSymbols ); /* stati #endif -#ifdef __BORLANDC__ +#if defined(__BORLANDC__) #define HB_INIT_SYMBOLS_BEGIN( func ) \ static HB_SYMB symbols[] = { @@ -107,7 +107,7 @@ extern void hb_vmProcessSymbols( PHB_SYMB pSymbols, USHORT uiSymbols ); /* stati static int static_int_##func = func(); #endif -#ifdef __WATCOMC__ +#if defined(__WATCOMC__) #define HB_INIT_SYMBOLS_BEGIN( func ) \ static HB_SYMB symbols[] = { diff --git a/harbour/include/hbsetup.h b/harbour/include/hbsetup.h index e0d35c7d9a..cae06c59bf 100644 --- a/harbour/include/hbsetup.h +++ b/harbour/include/hbsetup.h @@ -171,7 +171,7 @@ /* *********************************************************************** * Operating system specific definitions */ -#ifdef __GNUC__ +#if defined(__GNUC__) /* The GNU C compiler is used */ #if defined(__DJGPP__) || defined(HARBOUR_GCC_OS2) || defined(_Windows) || defined(_WIN32) /* The DJGPP port of GNU C is used - for DOS platform */ diff --git a/harbour/source/rtl/copyfile.c b/harbour/source/rtl/copyfile.c index ee4dd882ff..78855f13f7 100644 --- a/harbour/source/rtl/copyfile.c +++ b/harbour/source/rtl/copyfile.c @@ -37,7 +37,7 @@ #include "hbapierr.h" #include "hbapifs.h" -#ifdef OS_UNIX_COMPATIBLE +#if defined(OS_UNIX_COMPATIBLE) #include #include #endif @@ -73,7 +73,7 @@ static BOOL hb_fsCopy( char * szSource, char * szDest ) if( fhndDest != FS_ERROR ) { -#ifdef OS_UNIX_COMPATIBLE +#if defined(OS_UNIX_COMPATIBLE) struct stat struFileInfo; int iSuccess = fstat( fhndSource, &struFileInfo ); #endif @@ -100,7 +100,7 @@ static BOOL hb_fsCopy( char * szSource, char * szDest ) hb_xfree( buffer ); -#ifdef OS_UNIX_COMPATIBLE +#if defined(OS_UNIX_COMPATIBLE) if( iSuccess == 0 ) fchmod( fhndDest, struFileInfo.st_mode ); #endif diff --git a/harbour/source/rtl/environ.c b/harbour/source/rtl/environ.c index f95b736815..2c49bb7038 100644 --- a/harbour/source/rtl/environ.c +++ b/harbour/source/rtl/environ.c @@ -51,7 +51,7 @@ be ahead of any and all #include statements! */ -#ifdef __IBMCPP__ +#if defined(__IBMCPP__) #define INCL_DOSMISC #endif @@ -81,7 +81,7 @@ #include #endif -#ifdef __WATCOMC__ +#if defined(__WATCOMC__) #include #if defined(__386__) && !defined(__WINDOWS_386__) #define INT_86 int386 @@ -100,14 +100,14 @@ HARBOUR HB_OS( void ) { char * cformat = "%s %d.%02d%c"; -#ifdef __MPW__ +#if defined(__MPW__) /* TODO: not implemented yet */ hb_retc( "MacOS" ); #else int hb_osmajor = -1, hb_osminor = -1, hb_osletter = -1; char * hb_os = NULL; char version[ 128 ]; -#ifdef __IBMCPP__ +#if defined(__IBMCPP__) unsigned long aulQSV[ QSV_MAX ] = { 0 }; APIRET rc = DosQuerySysInfo( 1L, QSV_MAX, ( void * ) aulQSV, sizeof( ULONG ) * QSV_MAX ); @@ -326,7 +326,7 @@ HARBOUR HB_OS( void ) } } #endif /* __TURBOC__ or __BORLANDC__ or _MSC_VER 0r __DJGPP__ */ -#ifdef __DJGPP__ +#if defined(__DJGPP__) hb_os = hb_xgrab( strlen( _os_flavor ) + 1 ); strcpy( hb_os, _os_flavor ); hb_osmajor = _osmajor; @@ -348,7 +348,7 @@ HARBOUR HB_OS( void ) else sprintf( version, cformat, hb_os, hb_osmajor, hb_osminor, hb_osletter ); #endif hb_retc( version ); -#ifdef __DJGPP__ +#if defined(__DJGPP__) hb_xfree( hb_os ); #endif @@ -460,7 +460,7 @@ char * hb_version( USHORT uiMode ) #elif defined(__GNUC__) - #ifdef __EMX__ + #if defined(__EMX__) compiler = "GNU C/EMX C"; #else compiler = "GNU C"; diff --git a/harbour/source/rtl/filesys.c b/harbour/source/rtl/filesys.c index 7dc76d5da2..903474110b 100644 --- a/harbour/source/rtl/filesys.c +++ b/harbour/source/rtl/filesys.c @@ -151,11 +151,11 @@ #include #endif -#ifdef __MPW__ +#if defined(__MPW__) #include #endif -#ifdef DOS +#if defined(DOS) #include #endif @@ -1419,7 +1419,7 @@ BOOL hb_fsFile( BYTE * pFilename ) HB_TRACE(HB_TR_DEBUG, ("hb_fsFile(%s)", (char*) pFilename)); /* TODO: Check if F_OK is defined in all compilers */ -#ifdef OS_UNIX_COMPATIBLE +#if defined(OS_UNIX_COMPATIBLE) bIsFile = ( access( ( const char * ) pFilename, F_OK ) == 0 ); diff --git a/harbour/source/rtl/gt/gtdos.c b/harbour/source/rtl/gt/gtdos.c index 01c3ba3769..d118c4a680 100644 --- a/harbour/source/rtl/gt/gtdos.c +++ b/harbour/source/rtl/gt/gtdos.c @@ -67,7 +67,7 @@ #define FAR #endif -#ifdef __DJGPP__ +#if defined(__DJGPP__) #include #include #include @@ -134,7 +134,7 @@ void hb_gt_Init( void ) { HB_TRACE(HB_TR_DEBUG, ("hb_gt_Init()")); -#ifdef __DJGPP__ +#if defined(__DJGPP__) gppconio_init(); __djgpp_hwint_flags |= 2; /* Count Ctrl+Break instead of killing program */ __djgpp_set_ctrl_c( 0 ); /* Disable Ctrl+C */ @@ -415,7 +415,7 @@ static void hb_gt_xGetXY( USHORT cRow, USHORT cCol, BYTE * attr, BYTE * ch ) { HB_TRACE(HB_TR_DEBUG, ("hb_gt_xGetXY(%hu, %hu, %p, %p", cRow, cCol, ch, attr)); -#ifdef __DJGPP__ +#if defined(__DJGPP__) { short ch_attr; gettext( cCol + 1, cRow + 1, cCol + 1, cRow + 1, &ch_attr ); @@ -436,7 +436,7 @@ void hb_gt_xPutch( USHORT cRow, USHORT cCol, BYTE attr, BYTE ch ) { HB_TRACE(HB_TR_DEBUG, ("hb_gt_xPutch(%hu, %hu, %d, %d", cRow, cCol, (int) attr, (int) ch)); -#ifdef __DJGPP__ +#if defined(__DJGPP__) { long ch_attr; ch_attr = ( ch << 8 ) | attr; @@ -456,7 +456,7 @@ void hb_gt_Puts( USHORT cRow, USHORT cCol, BYTE attr, BYTE *str, ULONG len ) { HB_TRACE(HB_TR_DEBUG, ("hb_gt_Puts(%hu, %hu, %d, %p, %lu", cRow, cCol, (int) attr, str, len)); -#ifdef __DJGPP__ +#if defined(__DJGPP__) { int i; int bottom, left, right, top; @@ -515,7 +515,7 @@ void hb_gt_GetText( USHORT usTop, USHORT usLeft, USHORT usBottom, USHORT usRight { HB_TRACE(HB_TR_DEBUG, ("hb_gt_GetText(%hu, %hu, %hu, %hu, %p", usTop, usLeft, usBottom, usRight, dest)); -#ifdef __DJGPP__ +#if defined(__DJGPP__) { gettext( usLeft + 1, usTop + 1, usRight + 1, usBottom + 1, dest ); } @@ -539,7 +539,7 @@ void hb_gt_PutText( USHORT usTop, USHORT usLeft, USHORT usBottom, USHORT usRight { HB_TRACE(HB_TR_DEBUG, ("hb_gt_PutText(%hu, %hu, %hu, %hu, %p", usTop, usLeft, usBottom, usRight, srce)); -#ifdef __DJGPP__ +#if defined(__DJGPP__) { puttext( usLeft + 1, usTop + 1, usRight + 1, usBottom + 1, srce ); } diff --git a/harbour/source/rtl/inkey.c b/harbour/source/rtl/inkey.c index 3d06441738..2802be8312 100644 --- a/harbour/source/rtl/inkey.c +++ b/harbour/source/rtl/inkey.c @@ -82,7 +82,7 @@ of any and all #include statements and requires that Harbour includes are ahead of platform includes. */ -#ifdef __IBMCPP__ +#if defined(__IBMCPP__) #define INCL_DOSPROCESS #define INCL_NOPMAPI #endif @@ -131,7 +131,7 @@ #endif #include -#ifdef __WATCOMC__ +#if defined(__WATCOMC__) #include #include #if defined(__386__) && !defined(__WINDOWS__386__) diff --git a/harbour/source/rtl/isprint.c b/harbour/source/rtl/isprint.c index 89de2462dd..b22eaba045 100644 --- a/harbour/source/rtl/isprint.c +++ b/harbour/source/rtl/isprint.c @@ -44,7 +44,7 @@ #include #endif -#ifdef __WATCOMC__ +#if defined(__WATCOMC__) #include #if defined(__386__) && !defined(__WINDOWS_386__) #define INT_86 int386 @@ -74,7 +74,7 @@ HARBOUR HB_ISPRINTER( void ) USHORT uiPort = atoi( pszDOSPort + 3 ); BOOL bIsPrinter = FALSE; -#ifdef HB_LOCAL_DOS +#if defined(HB_LOCAL_DOS) /* NOTE: DOS specific solution, using BIOS interrupt */ @@ -83,7 +83,7 @@ HARBOUR HB_ISPRINTER( void ) union REGS regs; regs.h.ah = 2; - #ifdef __BORLANDC__ + #if defined(__BORLANDC__) regs.x.dx = uiPort - 1; #else regs.w.dx = uiPort - 1; diff --git a/harbour/source/rtl/mouse/mousewin.c b/harbour/source/rtl/mouse/mousewin.c index 2e95a11139..b9d20d6104 100644 --- a/harbour/source/rtl/mouse/mousewin.c +++ b/harbour/source/rtl/mouse/mousewin.c @@ -55,10 +55,8 @@ #endif #endif -#if ! defined(__GNUC__) -#ifdef __CYGWIN__ -typedef WORD far * LPWORD; -#endif +#if ! defined(__GNUC__) && defined(__CYGWIN__) + typedef WORD far * LPWORD; #endif /* __GNUC__ */ int hb_mouse_iCol; diff --git a/harbour/source/tools/io.c b/harbour/source/tools/io.c index a395c1cced..42bc4551e8 100644 --- a/harbour/source/tools/io.c +++ b/harbour/source/tools/io.c @@ -4,15 +4,15 @@ #include "hbapi.h" -#ifdef DOS -#include -#include -#include +#if defined(DOS) + #include + #include + #include #endif HARBOUR HB_CD( void ) { -#ifdef __DOS__ +#if defined(__DOS__) hb_retni( ISCHAR( 1 ) ? chdir( hb_parc( 1 ) ) : 0 ); #else hb_retni( 0 ); @@ -21,7 +21,7 @@ HARBOUR HB_CD( void ) HARBOUR HB_MD(void) { -#ifdef __DOS__ +#if defined(__DOS__) hb_retni( ISCHAR( 1 ) ? mkdir( hb_parc( 1 ) ) : 0 ); #else hb_retni( 0 ); @@ -30,7 +30,7 @@ HARBOUR HB_MD(void) HARBOUR HB_RD( void ) { -#ifdef __DOS__ +#if defined(__DOS__) hb_retni( ISCHAR( 1 ) ? rmdir( hb_parc( 1 ) ) : 0 ); #else hb_retni( 0 ); @@ -39,7 +39,7 @@ HARBOUR HB_RD( void ) HARBOUR HB_DISKUSED( void ) { -#ifdef DOS +#if defined(DOS) struct diskfree_t disk; long bytsfree, bytsfull; @@ -60,7 +60,7 @@ HARBOUR HB_DISKUSED( void ) HARBOUR HB_DISKFREE( void ) { -#ifdef DOS +#if defined(DOS) struct diskfree_t disk; _dos_getdiskfree( 0, &disk ); @@ -75,7 +75,7 @@ HARBOUR HB_DISKFREE( void ) HARBOUR HB_DISKFULL( void ) { -#ifdef DOS +#if defined(DOS) struct diskfree_t disk; _dos_getdiskfree( 0, &disk ); diff --git a/harbour/source/vm/itemapi.c b/harbour/source/vm/itemapi.c index d71d8ef461..d18f4f25fd 100644 --- a/harbour/source/vm/itemapi.c +++ b/harbour/source/vm/itemapi.c @@ -1191,7 +1191,7 @@ char * hb_itemStr( PHB_ITEM pNumber, PHB_ITEM pWidth, PHB_ITEM pDec ) #endif if( pNumber->item.asDouble.length == 99 - #ifdef __BORLANDC__ + #if defined(__BORLANDC__) /* No more checks for Borland C, which returns 0 for log( 0 ), and is therefore unable to test for infinity */ #else diff --git a/harbour/source/vm/maindll.c b/harbour/source/vm/maindll.c index de3bbcda60..c8567e7539 100644 --- a/harbour/source/vm/maindll.c +++ b/harbour/source/vm/maindll.c @@ -33,7 +33,7 @@ * */ -#ifdef _Windows +#if defined(_Windows) #include #include "hbvm.h" diff --git a/harbour/source/vm/mainwin.c b/harbour/source/vm/mainwin.c index 61d6582d3c..3bde706ac1 100644 --- a/harbour/source/vm/mainwin.c +++ b/harbour/source/vm/mainwin.c @@ -33,7 +33,7 @@ * */ -#ifdef _Windows +#if defined(_Windows) #include #include "hbapi.h"