From efe1e5b58bd082d6fa32f1b3193d73cd3beee9f8 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sun, 17 Jul 2011 13:26:52 +0000 Subject: [PATCH] 2011-07-17 15:26 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * include/extend.api * include/hbdefs.h * include/hbapi.h * include/clipdefs.h * contrib/hbpost.hbm * contrib/hbfimage/hbfimage.hbp * config/rules.mk - deleted HB_LEGACY_TYPES_OFF macro. it is the default in post 3.0.x Harbour versions. + added HB_LEGACY_TYPES_ON macro. This should be used when building C code which uses Clipper/Harbour legacy types (f.e. LONG or BOOL). It will stay until next stable version when all legacy types will be permanently removed. This gives time for 3rd party developers to update code to use Harbour (non-legacy) types in C code. See '2009-11-01 11:35 UTC+0100 Viktor Szakats' ChangeLog entry about non-legacy Harbour types. --- harbour/ChangeLog | 20 ++++++++++++++++++++ harbour/config/rules.mk | 2 -- harbour/contrib/hbfimage/hbfimage.hbp | 2 -- harbour/contrib/hbpost.hbm | 1 - harbour/include/clipdefs.h | 14 +++++++------- harbour/include/extend.api | 2 +- harbour/include/hbapi.h | 2 +- harbour/include/hbdefs.h | 4 ++-- 8 files changed, 31 insertions(+), 16 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 31367c8059..32560d91d9 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,26 @@ The license applies to all entries newer than 2009-04-28. */ +2011-07-17 15:26 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) + * include/extend.api + * include/hbdefs.h + * include/hbapi.h + * include/clipdefs.h + * contrib/hbpost.hbm + * contrib/hbfimage/hbfimage.hbp + * config/rules.mk + - deleted HB_LEGACY_TYPES_OFF macro. it is the default + in post 3.0.x Harbour versions. + + added HB_LEGACY_TYPES_ON macro. This should be used when + building C code which uses Clipper/Harbour legacy types + (f.e. LONG or BOOL). + It will stay until next stable version when all legacy + types will be permanently removed. This gives time for + 3rd party developers to update code to use Harbour + (non-legacy) types in C code. + See '2009-11-01 11:35 UTC+0100 Viktor Szakats' ChangeLog + entry about non-legacy Harbour types. + 2011-07-17 15:01 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * include/hbver.h * package/harbour.spec diff --git a/harbour/config/rules.mk b/harbour/config/rules.mk index f27aee87de..a19e4af5e1 100644 --- a/harbour/config/rules.mk +++ b/harbour/config/rules.mk @@ -14,8 +14,6 @@ else endif endif -HB_CFLAGS := -DHB_LEGACY_TYPES_OFF $(HB_CFLAGS) - # Handle it here, so that it can be disabled for individual libs ifeq ($(HB_PLATFORM),win) ifneq ($(__HB_BUILD_WINUNI),no) diff --git a/harbour/contrib/hbfimage/hbfimage.hbp b/harbour/contrib/hbfimage/hbfimage.hbp index feea2c6a0b..a2609a9705 100644 --- a/harbour/contrib/hbfimage/hbfimage.hbp +++ b/harbour/contrib/hbfimage/hbfimage.hbp @@ -18,8 +18,6 @@ -depincpath=freeimage:/opt/local/include -depimplibs=freeimage:../Dist/FreeImage.dll --cflag=-DHB_LEGACY_TYPES_OFF - -instfile=inc:freeimag.ch -instfile=inc:hbfimage.hbx diff --git a/harbour/contrib/hbpost.hbm b/harbour/contrib/hbpost.hbm index 9ef087e9bf..19ed7d8559 100644 --- a/harbour/contrib/hbpost.hbm +++ b/harbour/contrib/hbpost.hbm @@ -28,7 +28,6 @@ {win&allmsvc&HB_COMP_VER>'1400'}-dflag=-nxcompat {win&allmsvc&HB_COMP_VER>'1400'}-dflag=-dynamicbase --cflag=-DHB_LEGACY_TYPES_OFF {allwin&!(__HB_BUILD_WINUNI='no')}-winuni {allwin&(__HB_BUILD_WINUNI='unicows')}-lunicows diff --git a/harbour/include/clipdefs.h b/harbour/include/clipdefs.h index 6cb3af8818..e8210a7e3e 100644 --- a/harbour/include/clipdefs.h +++ b/harbour/include/clipdefs.h @@ -62,7 +62,7 @@ /* New types */ -#if !( defined( HB_OS_OS2 ) && defined( HB_DONT_DEFINE_BASIC_TYPES ) ) && ( defined( HB_LEGACY_TYPES_OFF ) || ! defined( HB_LEGACY_LEVEL3 ) ) +#if !( defined( HB_OS_OS2 ) && defined( HB_DONT_DEFINE_BASIC_TYPES ) ) && ( ! defined( HB_LEGACY_TYPES_ON ) || ! defined( HB_LEGACY_LEVEL3 ) ) typedef unsigned char BYTE; #endif typedef BYTE * BYTEP; @@ -71,7 +71,7 @@ typedef BYTEP BYTEPP; typedef BYTEP PBYTE; #endif -#if !( defined( HB_OS_OS2 ) && defined( HB_DONT_DEFINE_BASIC_TYPES ) ) && ( defined( HB_LEGACY_TYPES_OFF ) || ! defined( HB_LEGACY_LEVEL3 ) ) +#if !( defined( HB_OS_OS2 ) && defined( HB_DONT_DEFINE_BASIC_TYPES ) ) && ( ! defined( HB_LEGACY_TYPES_ON ) || ! defined( HB_LEGACY_LEVEL3 ) ) typedef short SHORT; #endif typedef SHORT * SHORTP; @@ -79,7 +79,7 @@ typedef SHORT * SHORTP; typedef SHORTP PSHORT; #endif -#if !( defined( HB_OS_OS2 ) && defined( HB_DONT_DEFINE_BASIC_TYPES ) ) && ( defined( HB_LEGACY_TYPES_OFF ) || ! defined( HB_LEGACY_LEVEL3 ) ) +#if !( defined( HB_OS_OS2 ) && defined( HB_DONT_DEFINE_BASIC_TYPES ) ) && ( ! defined( HB_LEGACY_TYPES_ON ) || ! defined( HB_LEGACY_LEVEL3 ) ) typedef unsigned short USHORT; #endif typedef USHORT * USHORTP; @@ -93,7 +93,7 @@ typedef WORD * WORDP; typedef WORDP PWORD; #endif -#if !( defined( HB_OS_OS2 ) && defined( HB_DONT_DEFINE_BASIC_TYPES ) ) && ( defined( HB_LEGACY_TYPES_OFF ) || ! defined( HB_LEGACY_LEVEL3 ) ) +#if !( defined( HB_OS_OS2 ) && defined( HB_DONT_DEFINE_BASIC_TYPES ) ) && ( ! defined( HB_LEGACY_TYPES_ON ) || ! defined( HB_LEGACY_LEVEL3 ) ) typedef long LONG; #endif typedef LONG * LONGP; @@ -101,7 +101,7 @@ typedef LONG * LONGP; typedef LONGP PLONG; #endif -#if !( defined( HB_OS_OS2 ) && defined( HB_DONT_DEFINE_BASIC_TYPES ) ) && ( defined( HB_LEGACY_TYPES_OFF ) || ! defined( HB_LEGACY_LEVEL3 ) ) +#if !( defined( HB_OS_OS2 ) && defined( HB_DONT_DEFINE_BASIC_TYPES ) ) && ( ! defined( HB_LEGACY_TYPES_ON ) || ! defined( HB_LEGACY_LEVEL3 ) ) typedef unsigned long ULONG; #endif typedef ULONG * ULONGP; @@ -113,7 +113,7 @@ typedef unsigned long DWORD; typedef DWORD * DWORDP; typedef DWORDP PDWORD; -#if !( defined( HB_OS_OS2 ) && defined( HB_DONT_DEFINE_BASIC_TYPES ) ) && ( defined( HB_LEGACY_TYPES_OFF ) || ! defined( HB_LEGACY_LEVEL3 ) ) +#if !( defined( HB_OS_OS2 ) && defined( HB_DONT_DEFINE_BASIC_TYPES ) ) && ( ! defined( HB_LEGACY_TYPES_ON ) || ! defined( HB_LEGACY_LEVEL3 ) ) #undef BOOL typedef USHORT BOOL; #endif @@ -147,7 +147,7 @@ typedef FUNCP * FUNCPP; #define HIDE static #define CLIPPER HARBOUR -#if defined( HB_LEGACY_TYPES_OFF ) || ! defined( HB_LEGACY_LEVEL3 ) +#if ! defined( HB_LEGACY_TYPES_ON ) || ! defined( HB_LEGACY_LEVEL3 ) # undef FALSE # define FALSE 0 # undef TRUE diff --git a/harbour/include/extend.api b/harbour/include/extend.api index f4b08d81a5..d585147723 100644 --- a/harbour/include/extend.api +++ b/harbour/include/extend.api @@ -91,7 +91,7 @@ typedef PHB_ITEM ITEM; #define PCOUNT hb_pcount() #define ALENGTH( n ) hb_parinfa( n, 0 ) -#if defined( HB_LEGACY_TYPES_OFF ) || ! defined( HB_LEGACY_LEVEL3 ) +#if ! defined( HB_LEGACY_TYPES_ON ) || ! defined( HB_LEGACY_LEVEL3 ) #define ISCHAR( n ) HB_ISCHAR( n ) #define ISNUM( n ) HB_ISNUM( n ) #define ISLOG( n ) HB_ISLOG( n ) diff --git a/harbour/include/hbapi.h b/harbour/include/hbapi.h index c1c4381985..253c901221 100644 --- a/harbour/include/hbapi.h +++ b/harbour/include/hbapi.h @@ -245,7 +245,7 @@ HB_EXTERN_BEGIN #define HB_ISDATETIME( n ) ( hb_param( n, HB_IT_DATETIME ) != NULL ) /* Compatibility #defines, deprecated */ -#if ! defined( HB_LEGACY_TYPES_OFF ) && defined( HB_LEGACY_LEVEL3 ) +#if defined( HB_LEGACY_TYPES_ON ) && defined( HB_LEGACY_LEVEL3 ) #define ISNIL( n ) HB_ISNIL( n ) #define ISCHAR( n ) HB_ISCHAR( n ) #define ISNUM( n ) HB_ISNUM( n ) diff --git a/harbour/include/hbdefs.h b/harbour/include/hbdefs.h index c922904635..2c2483825e 100644 --- a/harbour/include/hbdefs.h +++ b/harbour/include/hbdefs.h @@ -112,7 +112,7 @@ #define HB_DONT_DEFINE_BASIC_TYPES #endif -#elif defined( HB_OS_OS2 ) && ! defined( HB_LEGACY_TYPES_OFF ) && defined( HB_LEGACY_LEVEL3 ) +#elif defined( HB_OS_OS2 ) && defined( HB_LEGACY_TYPES_ON ) && defined( HB_LEGACY_LEVEL3 ) /* With the exception of WORD, the OS/2 header has its own definitions of the Harbour types most of which conflict with the @@ -388,7 +388,7 @@ typedef HB_UCHAR HB_U8; /* Legacy Windows/Clipper-style types */ -#if ! defined( HB_LEGACY_TYPES_OFF ) && defined( HB_LEGACY_LEVEL3 ) +#if defined( HB_LEGACY_TYPES_ON ) && defined( HB_LEGACY_LEVEL3 ) #if ! defined( HB_DONT_DEFINE_BASIC_TYPES ) #if ! defined( HB_DONT_DEFINE_BOOL )