From bc2bb362c74e11b751e370913a37b18eec370ee5 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Wed, 22 Mar 2000 21:56:34 +0000 Subject: [PATCH] 20000322-22:46 GMT+1 Victor Szakats --- harbour/ChangeLog | 21 ++++++++++++++ harbour/contrib/hbclip/hbstod.c | 4 +-- harbour/contrib/hbclip/hbstodx.c | 43 +++++++++++++++++++++++++++++ harbour/contrib/hbclip/make_clp.bat | 3 ++ harbour/include/hbdefs.h | 15 ++-------- harbour/source/rtl/dirdrive.c | 9 ++---- harbour/source/rtl/diskspac.c | 9 ++---- harbour/utils/hbrun/exttools.prg | 9 ------ harbour/utils/hbtest/hbtest.prg | 2 ++ harbour/utils/hbtest/make_c5x.bat | 32 +++++++++++++-------- 10 files changed, 100 insertions(+), 47 deletions(-) create mode 100644 harbour/contrib/hbclip/hbstodx.c diff --git a/harbour/ChangeLog b/harbour/ChangeLog index ac39ad6759..e4ba8c5052 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,3 +1,24 @@ +20000322-22:46 GMT+1 Victor Szakats + + * include/hbdefs.h + - Removed EXTERNAL_LINKAGE macro, it was not used anymore. + + + contrib/hbclip/hbstodx.c + * contrib/hbclip/make_clp.bat + + HB_STOD() function added. + + * utils/hbtest/make_c5x.bat + utils/hbtest/hbtest.prg + + If the HBCLIP.LIB is built, the regression test will automatically use + it, so the STOD() tests will pass in HBTEXT5X.EXE. + + * utils/hbrun/exttools.prg + - Removed IO.C functions. + + * source/rtl/diskspac.c + source/rtl/dirdrive.c + * Doc/comment/formatting changes. + 20000322-16:40 EST Paul Tucker * source/rtl/diskspac.c * no windows dialogs if disk not in drive. diff --git a/harbour/contrib/hbclip/hbstod.c b/harbour/contrib/hbclip/hbstod.c index b18381de7d..2975824c67 100644 --- a/harbour/contrib/hbclip/hbstod.c +++ b/harbour/contrib/hbclip/hbstod.c @@ -4,7 +4,7 @@ /* * Harbour Compatibility Library for CA-Cl*pper source code: - * STOD() function + * HB_STOD() function * * Copyright 2000 Victor Szakats * www - http://www.harbour-project.org @@ -35,7 +35,7 @@ #include "extend.h" -CLIPPER STOD( void ) +CLIPPER HB_STOD( void ) { /* The length check is a fix to avoid buggy behaviour of _retds() */ _retds( ( ISCHAR( 1 ) && _parclen( 1 ) == 8 ) ? _parc( 1 ) : " " ); diff --git a/harbour/contrib/hbclip/hbstodx.c b/harbour/contrib/hbclip/hbstodx.c new file mode 100644 index 0000000000..b18381de7d --- /dev/null +++ b/harbour/contrib/hbclip/hbstodx.c @@ -0,0 +1,43 @@ +/* + * $Id$ + */ + +/* + * Harbour Compatibility Library for CA-Cl*pper source code: + * STOD() function + * + * Copyright 2000 Victor Szakats + * www - http://www.harbour-project.org + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version, with one exception: + * + * The exception is that if you link the Harbour Runtime Library (HRL) + * and/or the Harbour Virtual Machine (HVM) with other files to produce + * an executable, this does not by itself cause the resulting executable + * to be covered by the GNU General Public License. Your use of that + * executable is in no way restricted on account of linking the HRL + * and/or HVM code into it. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA (or visit + * their web site at http://www.gnu.org/). + * + */ + +#include "extend.h" + +CLIPPER STOD( void ) +{ + /* The length check is a fix to avoid buggy behaviour of _retds() */ + _retds( ( ISCHAR( 1 ) && _parclen( 1 ) == 8 ) ? _parc( 1 ) : " " ); +} + diff --git a/harbour/contrib/hbclip/make_clp.bat b/harbour/contrib/hbclip/make_clp.bat index 62b4ea2589..70f8741026 100644 --- a/harbour/contrib/hbclip/make_clp.bat +++ b/harbour/contrib/hbclip/make_clp.bat @@ -10,6 +10,7 @@ clipper hbvaltoc.prg /n c:\devl\msc\bin\cl /c /AL /Zl /Oalt /Gs /W3 hbcolind.c c:\devl\msc\bin\cl /c /AL /Zl /Oalt /Gs /W3 hbstod.c +c:\devl\msc\bin\cl /c /AL /Zl /Oalt /Gs /W3 hbstodx.c del hbclip.lib @@ -17,8 +18,10 @@ lib hbclip -+ hbclip.obj ,, lib hbclip -+ hbkeyput.obj ,, lib hbclip -+ hbshadow.obj ,, lib hbclip -+ hbvaltoc.obj ,, + lib hbclip -+ hbcolind.obj ,, lib hbclip -+ hbstod.obj ,, +lib hbclip -+ hbstodx.obj ,, del hbclip.bak del *.obj diff --git a/harbour/include/hbdefs.h b/harbour/include/hbdefs.h index 6138ad941b..08929803e9 100644 --- a/harbour/include/hbdefs.h +++ b/harbour/include/hbdefs.h @@ -119,20 +119,11 @@ #define HB_SYMBOL_UNUSED( symbol ) ( void ) symbol #if defined(__GNUC__) - #define pascal __attribute__ ((stdcall)) -#endif - -#if defined(_MSC_VER) + #define HARBOUR void __attribute__ ((stdcall)) +#elif defined(_MSC_VER) || defined(__IBMCPP__) #define HARBOUR void - #define EXTERNAL_LINKAGE #else - #if defined(__IBMCPP__) - #define HARBOUR void - #define EXTERNAL_LINKAGE _LNK_CONV - #else - #define HARBOUR void pascal - #define EXTERNAL_LINKAGE - #endif + #define HARBOUR void pascal #endif #define __HARBOUR__ diff --git a/harbour/source/rtl/dirdrive.c b/harbour/source/rtl/dirdrive.c index 62a110e920..e00abf4f9d 100644 --- a/harbour/source/rtl/dirdrive.c +++ b/harbour/source/rtl/dirdrive.c @@ -33,6 +33,8 @@ * */ +/* NOTE: Clipper 5.3 functions */ + #include #include "hbapi.h" @@ -40,8 +42,6 @@ #ifdef HB_COMPAT_C53 -/* NOTE: Clipper 5.3 only */ - HB_FUNC( DIRCHANGE ) { USHORT uiErrorOld = hb_fsError(); @@ -54,8 +54,7 @@ HB_FUNC( DIRCHANGE ) hb_fsSetError( uiErrorOld ); } -/* NOTE: Clipper 5.3 only */ -/* NOTE: Clipper 5.3 NG incorrectly states that the name if this function is +/* NOTE: Clipper 5.3 NG incorrectly states that the name of this function is DIRMAKE(), in reality it's not. */ HB_FUNC( MAKEDIR ) @@ -70,8 +69,6 @@ HB_FUNC( MAKEDIR ) hb_fsSetError( uiErrorOld ); } -/* NOTE: Clipper 5.3 only */ - HB_FUNC( DIRREMOVE ) { USHORT uiErrorOld = hb_fsError(); diff --git a/harbour/source/rtl/diskspac.c b/harbour/source/rtl/diskspac.c index cd25ae9315..ebc59a383c 100644 --- a/harbour/source/rtl/diskspac.c +++ b/harbour/source/rtl/diskspac.c @@ -166,11 +166,7 @@ HB_FUNC( DISKSPACE ) memcpy( &i64RetVal, &i64TotalBytes, sizeof( ULARGE_INTEGER ) ); } - #if defined(__GNUC__) || defined( _MSC_VER) - - /* NOTE: In Cygwin/Mingw32 (egcs-2.91.57) the declaration for - ULARGE_INTEGER differs from the MS standard. - [vszakats] */ + #if defined(__GNUC__) || defined(_MSC_VER) dSpace = ( double ) i64RetVal.HighPart + ( double ) i64RetVal.HighPart * @@ -186,9 +182,10 @@ HB_FUNC( DISKSPACE ) } #else + /* NOTE: Borland doesn't seem to deal with the un-named struct that is part of ULARGE_INTEGER - [pt] */ + [pt] */ dSpace = ( double ) i64RetVal.u.HighPart + ( double ) i64RetVal.u.HighPart * diff --git a/harbour/utils/hbrun/exttools.prg b/harbour/utils/hbrun/exttools.prg index ba8b3cd505..830dc21074 100644 --- a/harbour/utils/hbrun/exttools.prg +++ b/harbour/utils/hbrun/exttools.prg @@ -120,15 +120,6 @@ EXTERNAL HB_FGOTOP EXTERNAL HB_FLASTREC EXTERNAL HB_FSELECT // -//symbols from file: tools\io.c -// -EXTERNAL CD -EXTERNAL MD -EXTERNAL RD -EXTERNAL DISKUSED -EXTERNAL DISKFREE -EXTERNAL DISKFULL -// //symbols from file: tools\mathx.c // EXTERNAL ACOS diff --git a/harbour/utils/hbtest/hbtest.prg b/harbour/utils/hbtest/hbtest.prg index 221e65f746..f531d6c0c7 100644 --- a/harbour/utils/hbtest/hbtest.prg +++ b/harbour/utils/hbtest/hbtest.prg @@ -488,6 +488,7 @@ STATIC FUNCTION CMDLGetValue( cCommandLine, cName, cRetVal ) RETURN cRetVal +#ifndef HAVE_HBCLIP #ifndef __HARBOUR__ #ifndef __XPP__ @@ -511,6 +512,7 @@ FUNCTION SToD( cDate ) #endif #endif +#endif /* Don't change the position of this #include. */ #include "rt_init.ch" diff --git a/harbour/utils/hbtest/make_c5x.bat b/harbour/utils/hbtest/make_c5x.bat index 2f4eb345f9..f313b37da6 100644 --- a/harbour/utils/hbtest/make_c5x.bat +++ b/harbour/utils/hbtest/make_c5x.bat @@ -3,19 +3,27 @@ rem rem $Id$ rem -clipper hbtest.prg /w /n -clipper rt_array.prg /w /n -clipper rt_date.prg /w /n -clipper rt_file.prg /w /n -clipper rt_hvm.prg /w /n -clipper rt_math.prg /w /n -clipper rt_misc.prg /w /n -clipper rt_str.prg /w /n -clipper rt_trans.prg /w /n +if not exist ..\..\contrib\hbclip\hbclip.lib goto NO_HBCLIP -if "%1"=="" set hb_linker=rtlink -if not "%1"=="" set hb_linker=exospace +set hb_clipopt=/DHAVE_HBCLIP +set hb_linkopt=li hbclip +set lib=..\..\contrib\hbclip\;%lib% -%hb_linker% out hbtest5x fi hbtest, rt_array, rt_date, rt_file, rt_hvm, rt_math, rt_misc, rt_str, rt_trans +:NO_HBCLIP + +clipper hbtest.prg /w /n %hb_clipopt% +clipper rt_array.prg /w /n %hb_clipopt% +clipper rt_date.prg /w /n %hb_clipopt% +clipper rt_file.prg /w /n %hb_clipopt% +clipper rt_hvm.prg /w /n %hb_clipopt% +clipper rt_math.prg /w /n %hb_clipopt% +clipper rt_misc.prg /w /n %hb_clipopt% +clipper rt_str.prg /w /n %hb_clipopt% +clipper rt_trans.prg /w /n %hb_clipopt% + +if "%1" == "" set hb_linker=rtlink +if not "%1" == "" set hb_linker=exospace + +%hb_linker% out hbtest5x fi hbtest,rt_array,rt_date,rt_file,rt_hvm,rt_math,rt_misc,rt_str,rt_trans %hb_linkopt% del *.obj