diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 8dcd551490..901b594cb9 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,3 +1,16 @@ +2001-04-20 18:05 UTC-0400 David G. Holm + + + include/hb_io.h + * source/common/hbtrace.c + * source/rtl/console.c + * source/rtl/dir.c + * source/rtl/disksphb.c + * source/rtl/filesys.c + * source/rtl/gtapi.c + + Instead of using #include and/or messy #ifdef blocks to + include and/or , just use #include "hb_io.h" + (based on an idea from Dave Pearson). + 2001-04-20 19:00 GMT+3 Alexander Kresin * contrib/libmisc/dbftools.c * fieldtype() fixed accordingly to RDD changes diff --git a/harbour/include/hb_io.h b/harbour/include/hb_io.h new file mode 100644 index 0000000000..62f1c9a516 --- /dev/null +++ b/harbour/include/hb_io.h @@ -0,0 +1,63 @@ +/* + * $Id$ + */ + +/* + * Harbour Project source code: + * A platform indpendent include file to include unistd.h and/or io.h + * + * Copyright 2001 Harbour Project + * 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, or (at your option) + * any later version. + * + * 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 software; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/). + * + * As a special exception, the Harbour Project gives permission for + * additional uses of the text contained in its release of Harbour. + * + * The exception is that, if you link the Harbour libraries 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 Harbour library code into it. + * + * This exception does not however invalidate any other reasons why + * the executable file might be covered by the GNU General Public License. + * + * This exception applies only to the code released by the Harbour + * Project under the name Harbour. If you copy code from other + * Harbour Project or Free Software Foundation releases into a copy of + * Harbour, as the General Public License permits, the exception does + * not apply to the code that you add in this way. To avoid misleading + * anyone as to the status of such modified files, you must delete + * this exception notice from them. + * + * If you write modifications of your own for Harbour, it is your choice + * whether to permit this exception to apply to your modifications. + * If you do not wish that, delete this exception notice. + * + */ + +#ifndef HB__IO_H_ +#define HB__IO_H_ + +#if defined(__GNUC__) && ! defined(__MINGW32__) + #include +#endif +#if !defined(OS_UNIX_COMPATIBLE) + #include +#endif + +#endif diff --git a/harbour/source/common/hbtrace.c b/harbour/source/common/hbtrace.c index 6ac975cb04..c6e727ed6f 100644 --- a/harbour/source/common/hbtrace.c +++ b/harbour/source/common/hbtrace.c @@ -54,9 +54,9 @@ #include #include #include -#include #include "hbapi.h" +#include "hb_io.h" #include "hbtrace.h" char * hb_tr_file_ = ""; diff --git a/harbour/source/rtl/console.c b/harbour/source/rtl/console.c index 248d60d985..30322522d2 100644 --- a/harbour/source/rtl/console.c +++ b/harbour/source/rtl/console.c @@ -74,13 +74,7 @@ #include "hbapifs.h" #include "hbapigt.h" #include "hbset.h" - -#if defined(__GNUC__) && ! defined(__MINGW32__) - #include -#endif -#if !defined(OS_UNIX_COMPATIBLE) - #include -#endif +#include "hb_io.h" /* length of buffer for CR/LF characters */ #define CRLF_BUFFER_LEN OS_EOL_LEN + 1 diff --git a/harbour/source/rtl/dir.c b/harbour/source/rtl/dir.c index 60cc6f1f0e..673e5a37aa 100644 --- a/harbour/source/rtl/dir.c +++ b/harbour/source/rtl/dir.c @@ -90,21 +90,17 @@ #include "hbapi.h" #include "hbapiitm.h" +#include "hb_io.h" #include "directry.ch" #if defined(__GNUC__) && !defined(__MINGW32__) #include #include - #include #include #include #include #include - #if !defined(OS_UNIX_COMPATIBLE) - #include - #endif - #if !defined(HAVE_POSIX_IO) #define HAVE_POSIX_IO #endif @@ -114,7 +110,6 @@ #include #include #include - #include #include #include #include @@ -126,7 +121,6 @@ #include #include #include - #include #include #include #include @@ -148,7 +142,6 @@ #if defined(__BORLANDC__) #include - #include #include #include #include diff --git a/harbour/source/rtl/disksphb.c b/harbour/source/rtl/disksphb.c index a63d114b52..151f63d2eb 100644 --- a/harbour/source/rtl/disksphb.c +++ b/harbour/source/rtl/disksphb.c @@ -104,7 +104,7 @@ HB_FUNC( HB_DISKSPACE ) } else { - if( hb_errRT_BASE_Ext1( EG_OPEN, 2018, NULL, NULL, 0, EF_CANDEFAULT | EF_CANRETRY ) == E_RETRY, 2, hb_paramError( 1 ), hb_paramError( 2 ) ) + if( hb_errRT_BASE_Ext1( EG_OPEN, 2018, NULL, NULL, 0, ( EF_CANDEFAULT | EF_CANRETRY ) == E_RETRY, 2, hb_paramError( 1 ), hb_paramError( 2 ) ) ) continue; } break; diff --git a/harbour/source/rtl/filesys.c b/harbour/source/rtl/filesys.c index b94bd9be81..f1262eb854 100644 --- a/harbour/source/rtl/filesys.c +++ b/harbour/source/rtl/filesys.c @@ -77,17 +77,14 @@ #include "hbapi.h" #include "hbapifs.h" +#include "hb_io.h" #if defined(__GNUC__) && !defined(__MINGW32__) #include #include - #include #include #include - #if !defined(OS_UNIX_COMPATIBLE) - #include - #endif #if defined(__DJGPP__) #include #define _getdrive getdisk @@ -106,7 +103,6 @@ #include #include #include - #include #include #include #include @@ -121,7 +117,6 @@ #include #include #include - #include #include #if defined(__BORLANDC__) #include diff --git a/harbour/source/rtl/gtapi.c b/harbour/source/rtl/gtapi.c index e2caafdc80..89e7dcc4ef 100644 --- a/harbour/source/rtl/gtapi.c +++ b/harbour/source/rtl/gtapi.c @@ -55,19 +55,11 @@ * */ -#if defined(__GNUC__) && ! defined(__MINGW32__) - #include - #if defined(__DJGPP__) || defined(__CYGWIN__) || defined(__EMX__) - #include - #endif -#else - #include -#endif - #include #include "hbapigt.h" #include "hbset.h" +#include "hb_io.h" static BOOL s_bInit = FALSE;