diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 9eaf7796ca..8815dac819 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,3 +1,31 @@ +20000411-02:32 GMT+1 Victor Szakats + + * source/common/hbver.h + * source/rtl/gtapi.c + * source/rtl/inkey.c + * source/rtl/dir.c + * source/rtl/diskspac.c + * source/rtl/gtpca/gtpca.c + * source/rtl/gtos2/gtos2.c + * source/rtl/gtos2/mouseos2.c + ! Fixed usage of HARBOUR_OS2_GCC before definition. + ! Now the INCL_* macros for OS/2 are always defined regardless of the + target platform, since at that point we don't know yet what is the + target platform. This may fix OS/2 GCC in some places. The only downside + in theory is that INCL_* may collide with some non-OS/2 defines. + Note that __IBMCPP__ != OS/2, it also has a Win32 version, and + __EMX__&!__RSXNT__ *is* OS/2. + * Some minor cleanups. + ! Fixed DIRECTORY() for OS/2 GCC and IBMCPP for Win32. Not tested. + - Removed explicit declaration for DosSleep(). + - Some superfluous #include statements removed from GTOS2. + + !! WARNING !! Please check IBMCPP/OS2 and GCC/OS2. I could not test + any of these. + + * source/rtl/run.c + ! Minor format. + 20000410-20:00 GMT -3 Luiz Rafael Culik + #include "hbapi.h" #include "hbapiitm.h" #include "directry.ch" @@ -137,7 +137,7 @@ #endif #endif -#if defined(__IBMCPP__) +#if defined(HB_OS_OS2) #include #include @@ -231,20 +231,18 @@ static USHORT osToHarbourMask( USHORT usMask ) usRetMask |= FA_TEMPORARY; /* F (T) */ if( S_ISSOCK( usMask ) ) usRetMask |= FA_SPARSE; /* K (P) */ -#else - #if defined(__IBMCPP__) - usRetMask = 0; - if( usMask & FILE_ARCHIVED ) - usRetMask |= FA_ARCH; - if( usMask & FILE_DIRECTORY ) - usRetMask |= FA_DIREC; - if( usMask & FILE_HIDDEN ) - usRetMask |= FA_HIDDEN; - if( usMask & FILE_READONLY ) - usRetMask |= FA_RDONLY; - if( usMask & FILE_SYSTEM ) - usRetMask |= FA_SYSTEM; - #endif +#elif defined(HB_OS_OS2) + usRetMask = 0; + if( usMask & FILE_ARCHIVED ) + usRetMask |= FA_ARCH; + if( usMask & FILE_DIRECTORY ) + usRetMask |= FA_DIREC; + if( usMask & FILE_HIDDEN ) + usRetMask |= FA_HIDDEN; + if( usMask & FILE_READONLY ) + usRetMask |= FA_RDONLY; + if( usMask & FILE_SYSTEM ) + usRetMask |= FA_SYSTEM; #endif return usRetMask; @@ -378,7 +376,7 @@ HB_FUNC( DIRECTORY ) #elif defined(_MSC_VER) struct _find_t entry; long hFile; -#elif defined(__IBMCPP__) +#elif defined(HB_OS_OS2) FILEFINDBUF3 entry; HDIR hFind = HDIR_CREATE; ULONG fileTypes = FILE_ARCHIVED | FILE_DIRECTORY | FILE_SYSTEM | FILE_HIDDEN | FILE_READONLY; @@ -509,7 +507,7 @@ HB_FUNC( DIRECTORY ) do { strcpy( string, entry.name ); -#elif defined(__IBMCPP__) +#elif defined(HB_OS_OS2) strcpy( string, dirname ); strcat( string, pattern ); @@ -601,7 +599,7 @@ HB_FUNC( DIRECTORY ) #elif defined(_MSC_VER) strcpy( filename, entry.name ); strcpy( fullfile, dirname ); -#elif defined(__IBMCPP__) +#elif defined(HB_OS_OS2) strcpy( filename, entry.achName ); strcpy( fullfile, dirname ); #else @@ -619,7 +617,7 @@ HB_FUNC( DIRECTORY ) #if defined(OS_UNIX_COMPATIBLE) /* GNU C on Linux or on other UNIX */ attrib = statbuf.st_mode; - #elif defined(__IBMCPP__) + #elif defined(HB_OS_OS2) attrib = entry.attrFile; #elif defined(__MINGW32__) || defined(_MSC_VER) attrib = entry.attrib; @@ -704,14 +702,14 @@ HB_FUNC( DIRECTORY ) _findclose( hFile ); #elif defined(_MSC_VER ) while( _dos_findnext( &entry ) == 0 ); -#elif defined(__IBMCPP__) +#elif defined(HB_OS_OS2) while( DosFindNext( hFind, &entry, findSize, &findCount ) == NO_ERROR && findCount > 0 ); DosFindClose( hFind ); #else closedir( dir ); #endif -#if defined(_MSC_VER) || defined(__MINGW32__) || defined(__IBMCPP__) +#if defined(_MSC_VER) || defined(__MINGW32__) || defined(HB_OS_OS2) } #endif diff --git a/harbour/source/rtl/diskspac.c b/harbour/source/rtl/diskspac.c index 32d0d92d08..2dd93b4704 100644 --- a/harbour/source/rtl/diskspac.c +++ b/harbour/source/rtl/diskspac.c @@ -37,18 +37,16 @@ return a (long) value, Harbour may return a (double) for large values, the decimal places are always set to zero, though. */ +/* NOTE: For OS/2. Must be ahead of any and all #include statements */ +#define INCL_BASE +#define INCL_DOSERRORS + #define HB_OS_WIN_32_USED #include "hbapi.h" #include "hbapierr.h" #include "hbapifs.h" -#if defined(HB_OS_OS2) - #define INCL_BASE - #define INCL_DOSERRORS - #include -#endif - /* NOTE: The second parameter is a Harbour extension, check fileio.ch for the possible values. */ diff --git a/harbour/source/rtl/gtapi.c b/harbour/source/rtl/gtapi.c index fa2332fe41..4e59ff78c1 100644 --- a/harbour/source/rtl/gtapi.c +++ b/harbour/source/rtl/gtapi.c @@ -57,7 +57,7 @@ #if defined(__GNUC__) && ! defined(__MINGW32__) #include - #if defined(__DJGPP__) || defined(__CYGWIN__) || defined(HARBOUR_GCC_OS2) + #if defined(__DJGPP__) || defined(__CYGWIN__) || defined(__EMX__) #include #endif #else diff --git a/harbour/source/rtl/gtos2/gtos2.c b/harbour/source/rtl/gtos2/gtos2.c index f74e143a54..f57beb1159 100644 --- a/harbour/source/rtl/gtos2/gtos2.c +++ b/harbour/source/rtl/gtos2/gtos2.c @@ -54,12 +54,13 @@ /* NOTE: User programs should never call this layer directly! */ - #define INCL_BASE #define INCL_VIO #define INCL_DOSPROCESS #define INCL_NOPMAPI -#include + +#include "hbapigt.h" +#include "inkey.ch" /* convert 16:16 address to 0:32 */ #define SELTOFLAT(ptr) (void *)(((((ULONG)(ptr))>>19)<<16)|(0xFFFF&((ULONG)(ptr)))) @@ -69,15 +70,10 @@ OS/2 GCC hasn't got ToolKit headers available */ #include #else - #include #include #endif #include -#include "hbapigt.h" -#include "inkey.ch" - - static char hb_gt_GetCellSize( void ); static char * hb_gt_ScreenPtr( USHORT cRow, USHORT cCol ); static void hb_gt_xGetXY( USHORT cRow, USHORT cCol, BYTE * attr, BYTE * ch ); diff --git a/harbour/source/rtl/gtos2/mouseos2.c b/harbour/source/rtl/gtos2/mouseos2.c index 335582c68f..69da66321a 100644 --- a/harbour/source/rtl/gtos2/mouseos2.c +++ b/harbour/source/rtl/gtos2/mouseos2.c @@ -37,7 +37,6 @@ #define INCL_VIO /* needed only for VioGetMode/VIOMODEINFO */ #define INCL_NOPMAPI /* exclude Presentation Manager Include File */ -#include #include "hbapigt.h" static HMOU s_uMouHandle; /* mouse logical handle */ diff --git a/harbour/source/rtl/gtpca/gtpca.c b/harbour/source/rtl/gtpca/gtpca.c index 3c815afc98..5e53008b39 100644 --- a/harbour/source/rtl/gtpca/gtpca.c +++ b/harbour/source/rtl/gtpca/gtpca.c @@ -42,12 +42,13 @@ #if defined(__GNUC__) && ! defined(__MINGW32__) #include - #if defined(__DJGPP__) || defined(__CYGWIN__) || defined(HARBOUR_GCC_OS2) + #if defined(__DJGPP__) || defined(__CYGWIN__) || defined(__EMX__) #include #endif #else #include #endif + #include #include diff --git a/harbour/source/rtl/inkey.c b/harbour/source/rtl/inkey.c index 127be8bf7e..f51c7a2de1 100644 --- a/harbour/source/rtl/inkey.c +++ b/harbour/source/rtl/inkey.c @@ -44,14 +44,9 @@ * */ -/* Note: The following #ifdef block for __IBMCPP__ must be ahead - of any and all #include statements and requires that - Harbour includes are ahead of platform includes. -*/ -#if defined(__IBMCPP__) - #define INCL_DOSPROCESS - #define INCL_NOPMAPI -#endif +/* NOTE: For OS/2. Must be ahead of any and all #include statements */ +#define INCL_DOSPROCESS +#define INCL_NOPMAPI #include "hbapi.h" #include "hbapierr.h" @@ -63,10 +58,6 @@ #include -#if defined(HARBOUR_GCC_OS2) - ULONG DosSleep( ULONG ulMilliseconds ); -#endif - static int * s_inkeyBuffer = 0; /* Harbour keyboard buffer (empty if head == tail) */ static int s_inkeyHead; /* Harbour keyboard buffer head pointer (next insert) */ static int s_inkeyTail; /* Harbour keyboard buffer tail pointer (next extract) */ diff --git a/harbour/source/rtl/run.c b/harbour/source/rtl/run.c index 12e7d3507c..23e69e6ce0 100644 --- a/harbour/source/rtl/run.c +++ b/harbour/source/rtl/run.c @@ -38,7 +38,7 @@ HB_FUNC( __RUN ) { -#if defined(__TURBOC__) || defined(__BORLANDC__) || defined(_MSC_VER) || defined(__IBMCPP__) || defined(__GNUC__) +#if defined(__TURBOC__) || defined(__BORLANDC__) || defined(_MSC_VER) || defined(__IBMCPP__) || defined(__GNUC__) if( ISCHAR( 1 ) ) system( hb_parc( 1 ) ); #else