From 53c7ccc18bd3883875ad820712e11969556c67e6 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Fri, 27 Jun 2008 10:27:35 +0000 Subject: [PATCH] 2008-06-27 12:24 UTC+0200 Viktor Szakats (harbour.01 syenar hu) * include/hbstdgen.ch * include/hbver.h * include/hbdefs.h * source/pp/pplib.c * source/pp/ppcore.c * source/pp/hbpp.c * source/common/hbver.c * source/common/hbverdsp.c * contrib/hbsqlit3/hbsqlit3.c * contrib/examples/pp/hbppdef.h * Changed .c level __HARBOUR__ to have the same value as the existing .prg level one. * PP now gets the __HARBOUR__ define directly from the .c level instead of generating it locally. ; QUESTION: Should or shouldn't we change __HARBOUR__ to contain revision number too? (0x0100 -> 0x01000) This would allow for a greater level of development opportunities between minor revisions, more "agile" development. * include/hbpp.h * source/pp/ppcore.c - Two __XHARBOUR__ guards removed. --- harbour/ChangeLog | 25 +++++++++++++++++++++++++ harbour/contrib/examples/pp/hbppdef.h | 1 - harbour/contrib/hbsqlit3/hbsqlit3.c | 1 - harbour/include/hbdefs.h | 5 +---- harbour/include/hbpp.h | 3 +++ harbour/include/hbstdgen.ch | 8 +++++++- harbour/include/hbver.h | 10 ++++++++++ harbour/source/common/hbver.c | 1 - harbour/source/common/hbverdsp.c | 7 ------- harbour/source/pp/hbpp.c | 3 +-- harbour/source/pp/ppcore.c | 24 ++++++------------------ harbour/source/pp/pplib.c | 2 +- 12 files changed, 54 insertions(+), 36 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 95856d5dc1..880992ef5c 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,31 @@ 2008-12-31 13:59 UTC+0100 Foo Bar */ +2008-06-27 12:24 UTC+0200 Viktor Szakats (harbour.01 syenar hu) + * include/hbstdgen.ch + * include/hbver.h + * include/hbdefs.h + * source/pp/pplib.c + * source/pp/ppcore.c + * source/pp/hbpp.c + * source/common/hbver.c + * source/common/hbverdsp.c + * contrib/hbsqlit3/hbsqlit3.c + * contrib/examples/pp/hbppdef.h + * Changed .c level __HARBOUR__ to have the same value + as the existing .prg level one. + * PP now gets the __HARBOUR__ define directly from the .c + level instead of generating it locally. + ; QUESTION: Should or shouldn't we change __HARBOUR__ + to contain revision number too? (0x0100 -> 0x01000) + This would allow for a greater level of development + opportunities between minor revisions, more "agile" + development. + + * include/hbpp.h + * source/pp/ppcore.c + - Two __XHARBOUR__ guards removed. + 2008-06-27 03:27 UTC+0200 Viktor Szakats (harbour.01 syenar hu) * contrib/gtwvg/Makefile * contrib/gtwvg/common.mak diff --git a/harbour/contrib/examples/pp/hbppdef.h b/harbour/contrib/examples/pp/hbppdef.h index b390922590..96afe4f3b2 100644 --- a/harbour/contrib/examples/pp/hbppdef.h +++ b/harbour/contrib/examples/pp/hbppdef.h @@ -56,7 +56,6 @@ #include "hbapi.h" #include "hbapifs.h" #include "hberrors.h" -#include "hbver.h" HB_EXTERN_BEGIN diff --git a/harbour/contrib/hbsqlit3/hbsqlit3.c b/harbour/contrib/hbsqlit3/hbsqlit3.c index 3cc0f8f319..3af57895bb 100644 --- a/harbour/contrib/hbsqlit3/hbsqlit3.c +++ b/harbour/contrib/hbsqlit3/hbsqlit3.c @@ -63,7 +63,6 @@ #include "hbapiitm.h" #include "hbapierr.h" #include "hbapifs.h" -#include "hbver.h" #ifdef NODLL extern char * sqlite3_temp_directory; diff --git a/harbour/include/hbdefs.h b/harbour/include/hbdefs.h index 37b9f7d277..da2cb12d53 100644 --- a/harbour/include/hbdefs.h +++ b/harbour/include/hbdefs.h @@ -61,6 +61,7 @@ #include "hbsetup.h" #include "hbtrace.h" +#include "hbver.h" #if defined( __XCC__ ) || defined( __MINGW32__ ) || \ ( defined( __GNUC__ ) && \ @@ -1146,10 +1147,6 @@ typedef unsigned long HB_COUNTER; #define HARBOUR void #endif -#if ! defined(__HARBOUR__) - #define __HARBOUR__ -#endif - typedef HARBOUR ( * PHB_FUNC )( void ); typedef PHB_FUNC HB_FUNC_PTR; diff --git a/harbour/include/hbpp.h b/harbour/include/hbpp.h index 0cde68552f..c586feae2f 100644 --- a/harbour/include/hbpp.h +++ b/harbour/include/hbpp.h @@ -198,9 +198,12 @@ typedef HB_PP_SWITCH_FUNC * PHB_PP_SWITCH_FUNC; #define HB_PP_TOKEN_MOD 84 #define HB_PP_TOKEN_POWER 85 #define HB_PP_TOKEN_EPSILON 86 +/* xhb stuff */ +#if 0 #define HB_PP_TOKEN_SHIFTL 87 #define HB_PP_TOKEN_SHIFTR 88 #define HB_PP_TOKEN_BITXOR 89 +#endif #define HB_PP_TOKEN_TYPE(t) ( (t) & 0xff ) /* bitfields */ diff --git a/harbour/include/hbstdgen.ch b/harbour/include/hbstdgen.ch index 106b343f8d..4fe2d2d75f 100644 --- a/harbour/include/hbstdgen.ch +++ b/harbour/include/hbstdgen.ch @@ -52,13 +52,19 @@ /* include hbsetup.ch to set default build settings */ #include "hbsetup.ch" +/* include version macros */ +#ifndef _HB_PRG_LEVEL + #define _HB_PRG_LEVEL +#endif +#include "hbver.h" +#undef _HB_PRG_LEVEL /* include std.ch to set default rules */ #include "std.ch" /* undefine all rules which are not necessary in default PP tables */ +#undef HB_VER_H_ #undef HB_SETUP_CH_ -#undef __HARBOUR__ #undef __DATE__ #undef __TIME__ #undef __HB_MAIN__ diff --git a/harbour/include/hbver.h b/harbour/include/hbver.h index e85ff551a0..7116553819 100644 --- a/harbour/include/hbver.h +++ b/harbour/include/hbver.h @@ -53,6 +53,8 @@ #ifndef HB_VER_H_ #define HB_VER_H_ +#ifndef _HB_PRG_LEVEL + /* NOTE: One of these next three fields can be incremented by the hbverfix program */ #define HB_VER_MAJOR 1 /* Major version number */ @@ -61,6 +63,14 @@ #define HB_VER_STATUS "RC1" /* Build status */ #define HB_VERSION 0x010000 /* Three bytes: Major + Minor + Revision */ +#endif + /* #include "hb_verbld.h" */ +#if defined(__HARBOUR__) + #undef __HARBOUR__ +#endif + +#define __HARBOUR__ 0x0100 /* Two bytes: Major + Minor. This is recommented for 3rd party .c and .prg level code. */ + #endif /* HB_VER_H_ */ diff --git a/harbour/source/common/hbver.c b/harbour/source/common/hbver.c index 93bddfab3b..8378de1760 100644 --- a/harbour/source/common/hbver.c +++ b/harbour/source/common/hbver.c @@ -75,7 +75,6 @@ #define HB_OS_WIN_32_USED #include "hbapi.h" -#include "hbver.h" #include "hbmemory.ch" #if defined(HB_OS_WIN_32) diff --git a/harbour/source/common/hbverdsp.c b/harbour/source/common/hbverdsp.c index e7829d9178..aefce8f061 100644 --- a/harbour/source/common/hbverdsp.c +++ b/harbour/source/common/hbverdsp.c @@ -50,14 +50,7 @@ * */ -/* - * - * See doc/license.txt for licensing terms. - * - */ - #include "hbapi.h" -#include "hbver.h" #include "hbmemory.ch" void hb_verBuildInfo( void ) diff --git a/harbour/source/pp/hbpp.c b/harbour/source/pp/hbpp.c index 450589b890..cae3aa6dd9 100644 --- a/harbour/source/pp/hbpp.c +++ b/harbour/source/pp/hbpp.c @@ -236,8 +236,7 @@ static void hb_pp_undefCompilerRules( PHB_PP_STATE pState ) { int i; PHB_PP_RULE * pRulePtr, pRule; - char * szRules[] = { "__HARBOUR__", - "__DATE__", + char * szRules[] = { "__DATE__", "__TIME__", "__HB_MAIN__", "__ARCH16BIT__", diff --git a/harbour/source/pp/ppcore.c b/harbour/source/pp/ppcore.c index 96db597899..5e32509cd1 100644 --- a/harbour/source/pp/ppcore.c +++ b/harbour/source/pp/ppcore.c @@ -63,7 +63,6 @@ #endif #include "hbpp.h" -#include "hbver.h" #include "hbdate.h" #define HB_PP_WARN_DEFINE_REDEF 1 /* C1005 */ @@ -177,11 +176,6 @@ static const HB_PP_OPERATOR s_operators[] = { "!=" , 2, "<>" , HB_PP_TOKEN_NE | HB_PP_TOKEN_STATIC }, { "<>" , 2, "<>" , HB_PP_TOKEN_NE | HB_PP_TOKEN_STATIC }, { "->" , 2, "->" , HB_PP_TOKEN_ALIAS | HB_PP_TOKEN_STATIC }, -#ifdef __XHARBOUR__ - { "<<" , 2, "<<" , HB_PP_TOKEN_SHIFTL | HB_PP_TOKEN_STATIC }, - { ">>" , 2, ">>" , HB_PP_TOKEN_SHIFTR | HB_PP_TOKEN_STATIC }, - { "^^" , 2, "^^" , HB_PP_TOKEN_BITXOR | HB_PP_TOKEN_STATIC }, -#endif { "@" , 1, "@" , HB_PP_TOKEN_REFERENCE | HB_PP_TOKEN_STATIC }, { "(" , 1, "(" , HB_PP_TOKEN_LEFT_PB | HB_PP_TOKEN_STATIC }, { ")" , 1, ")" , HB_PP_TOKEN_RIGHT_PB | HB_PP_TOKEN_STATIC }, @@ -4382,11 +4376,14 @@ static PHB_PP_TOKEN hb_pp_calcPrecedence( PHB_PP_TOKEN pToken, *piNextPrec = HB_PP_PREC_BIT; break; +/* xhb stuff */ +#if 0 case HB_PP_TOKEN_BITXOR: case HB_PP_TOKEN_SHIFTL: case HB_PP_TOKEN_SHIFTR: *piNextPrec = HB_PP_PREC_BIT; break; +#endif /* math plus/minus */ case HB_PP_TOKEN_PLUS: @@ -4448,6 +4445,8 @@ static HB_LONG hb_pp_calcOperation( HB_LONG lValueLeft, HB_LONG lValueRight, lValueLeft &= lValueRight; break; case HB_PP_TOKEN_POWER: +/* xhb stuff */ +#if 0 case HB_PP_TOKEN_BITXOR: lValueLeft ^= lValueRight; break; @@ -4457,6 +4456,7 @@ static HB_LONG hb_pp_calcOperation( HB_LONG lValueLeft, HB_LONG lValueRight, case HB_PP_TOKEN_SHIFTR: lValueLeft >>= lValueRight; break; +#endif case HB_PP_TOKEN_PLUS: lValueLeft += lValueRight; @@ -5220,18 +5220,6 @@ void hb_pp_initDynDefines( PHB_PP_STATE pState ) hb_pp_addDefine( pState, szDefine, szResult ); #endif -#if defined( __HARBOUR__ ) || defined( __XHARBOUR__ ) - snprintf( szResult, sizeof( szResult ), "%05d", HB_MAX( ( HB_VER_MAJOR << 8 ) | HB_VER_MINOR, 1 ) ); -#ifdef __HARBOUR__ - /* __HARBOUR__ */ - hb_pp_addDefine( pState, "__HARBOUR__", szResult ); -#endif -#ifdef __XHARBOUR__ - /* __XHARBOUR__ */ - hb_pp_addDefine( pState, "__XHARBOUR__", szResult ); -#endif -#endif - /* __DATE__ */ hb_dateToday( &iYear, &iMonth, &iDay ); hb_dateStrPut( szResult + 1, iYear, iMonth, iDay ); diff --git a/harbour/source/pp/pplib.c b/harbour/source/pp/pplib.c index a25e49be2e..68c30aa8b1 100644 --- a/harbour/source/pp/pplib.c +++ b/harbour/source/pp/pplib.c @@ -134,7 +134,7 @@ PHB_PP_STATE hb_pp_Param( int iParam ) * initialize new PP context and return pointer to it. * __PP_INIT( [] [, ] ) * when is empty string ("") then no default rules are used - * only the dynamically created #defines like __HARBOUR__, __DATE__, __TIME__ + * only the dynamically created #defines like __DATE__, __TIME__ */ HB_FUNC( __PP_INIT ) {