From e5abaa5fb466921bcc266710830cd4834c7897d5 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Tue, 9 Feb 2010 01:13:25 +0000 Subject: [PATCH] 2010-02-09 02:12 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) * src/vm/runner.c * src/vm/garbage.c * src/vm/classes.c * src/rtl/cdpapi.c * src/rtl/cdpapihb.c * src/rdd/dbcmd.c * include/hbapicdp.h * include/hbapiitm.h * include/hbextern.ch * include/hbdefs.h * include/hbsetup.h * include/hbapi.h - Deleted code guarded with (previously disabled) HB_LEGACY_LEVEL2 * include/rdd.api * include/clipdefs.h + Permanently enabled HB_LEGACY_LEVEL2 related changes. * contrib/xhb/bkgtsks.c - Deleted HB_OS_WIN_USED. It wasn't used. * include/hbapi.h * src/vm/cmdarg.c * hb_winmainArgGet() changed to not use Windows types. This function is declared in hbapi.h and this header shouldn't depend on windows.h. * include/hbwince.h * include/hbsetup.h * HB_OS_HAS_DRIVE_LETTER is now configured in central place (hbsetup.h) for WinCE platform also. * include/hbwince.h * include/hbdefs.h * Windows (CE and not-CE) specific declarations moved from hbwince.h to hbdefs.h. * include/hbdefs.h % hbwince.h inclusion now better guarded to not include it for non WinCE platforms. + HB_OS_WIN_USED macro will now autodetected by checking whether windows.h was included before this header. This is required for hbwince.h. I don't like it, since hbapi.h still depends on windows.h for WinCE platform, which still ties us to unnecessary windows.h inclusion rules. Rather, hbwince.h should be included directly by .c files when needed and when HB_OS_WIN_CE is defined. After all this our little Windows API implementation for compilers which need it. * include/hbdefs.h * include/hbwmain.c + hb_winmainArgInit() declaration moved to hbwmain.c, the only place where this is used. * Deleted HB_EXPORT from hb_winmainArgInit. Pls speak up if this is wrong. It's possible to move this back to hbdefs.h, but parameter types should be changed to ANSI ones. * contrib/gtwvg/gtwvg.c * contrib/gtwvg/gtwvg.h * contrib/gtwvg/wvggui.c * contrib/gtwvg/wvgcuig.c * contrib/gtwvg/wvggui.h * contrib/gtwvg/wvgwin.c * contrib/gtwvg/wvgutils.c * contrib/gtwvg/wvgcore.c * contrib/gtwvg/wvgwing.c - Deleted HB_OS_WIN_USED. Now it should work without it. windows.h was already included in non-official method, so it's now okay also. --- harbour/ChangeLog | 72 +++++++++ harbour/contrib/gtwvg/gtwvg.c | 2 - harbour/contrib/gtwvg/gtwvg.h | 1 - harbour/contrib/gtwvg/wvgcore.c | 4 - harbour/contrib/gtwvg/wvgcuig.c | 2 - harbour/contrib/gtwvg/wvggui.c | 2 - harbour/contrib/gtwvg/wvggui.h | 1 - harbour/contrib/gtwvg/wvgutils.c | 4 - harbour/contrib/gtwvg/wvgwin.c | 3 +- harbour/contrib/gtwvg/wvgwing.c | 3 +- harbour/contrib/xhb/bkgtsks.c | 2 - harbour/include/clipdefs.h | 4 +- harbour/include/hbapi.h | 27 +--- harbour/include/hbapicdp.h | 5 - harbour/include/hbapiitm.h | 6 - harbour/include/hbdefs.h | 71 +++++++-- harbour/include/hbextern.ch | 3 - harbour/include/hbsetup.h | 24 +-- harbour/include/hbwince.h | 247 +++++++++++++------------------ harbour/include/hbwmain.c | 4 + harbour/include/rdd.api | 6 +- harbour/src/rdd/dbcmd.c | 10 -- harbour/src/rtl/cdpapi.c | 32 ---- harbour/src/rtl/cdpapihb.c | 9 -- harbour/src/vm/classes.c | 56 ------- harbour/src/vm/cmdarg.c | 6 +- harbour/src/vm/garbage.c | 60 -------- harbour/src/vm/runner.c | 32 ---- 28 files changed, 245 insertions(+), 453 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index ee97b1ab8e..f60f97f554 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,78 @@ past entries belonging to author(s): Viktor Szakats. */ +2010-02-09 02:12 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) + * src/vm/runner.c + * src/vm/garbage.c + * src/vm/classes.c + * src/rtl/cdpapi.c + * src/rtl/cdpapihb.c + * src/rdd/dbcmd.c + * include/hbapicdp.h + * include/hbapiitm.h + * include/hbextern.ch + * include/hbdefs.h + * include/hbsetup.h + * include/hbapi.h + - Deleted code guarded with (previously disabled) HB_LEGACY_LEVEL2 + + * include/rdd.api + * include/clipdefs.h + + Permanently enabled HB_LEGACY_LEVEL2 related changes. + + * contrib/xhb/bkgtsks.c + - Deleted HB_OS_WIN_USED. It wasn't used. + + * include/hbapi.h + * src/vm/cmdarg.c + * hb_winmainArgGet() changed to not use Windows types. + This function is declared in hbapi.h and this header + shouldn't depend on windows.h. + + * include/hbwince.h + * include/hbsetup.h + * HB_OS_HAS_DRIVE_LETTER is now configured in central + place (hbsetup.h) for WinCE platform also. + + * include/hbwince.h + * include/hbdefs.h + * Windows (CE and not-CE) specific declarations moved from + hbwince.h to hbdefs.h. + + * include/hbdefs.h + % hbwince.h inclusion now better guarded to not include it + for non WinCE platforms. + + HB_OS_WIN_USED macro will now autodetected by checking + whether windows.h was included before this header. + This is required for hbwince.h. I don't like it, since + hbapi.h still depends on windows.h for WinCE platform, + which still ties us to unnecessary windows.h inclusion + rules. Rather, hbwince.h should be included directly + by .c files when needed and when HB_OS_WIN_CE is defined. + After all this our little Windows API implementation + for compilers which need it. + + * include/hbdefs.h + * include/hbwmain.c + + hb_winmainArgInit() declaration moved to hbwmain.c, the + only place where this is used. + * Deleted HB_EXPORT from hb_winmainArgInit. Pls speak up if + this is wrong. It's possible to move this back to hbdefs.h, + but parameter types should be changed to ANSI ones. + + * contrib/gtwvg/gtwvg.c + * contrib/gtwvg/gtwvg.h + * contrib/gtwvg/wvggui.c + * contrib/gtwvg/wvgcuig.c + * contrib/gtwvg/wvggui.h + * contrib/gtwvg/wvgwin.c + * contrib/gtwvg/wvgutils.c + * contrib/gtwvg/wvgcore.c + * contrib/gtwvg/wvgwing.c + - Deleted HB_OS_WIN_USED. Now it should work without it. + windows.h was already included in non-official method, so + it's now okay also. + 2010-02-09 00:43 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) * contrib/hbfimage/Makefile - No more relevant comment deleted. diff --git a/harbour/contrib/gtwvg/gtwvg.c b/harbour/contrib/gtwvg/gtwvg.c index 39d4d5422d..985fa5c81b 100644 --- a/harbour/contrib/gtwvg/gtwvg.c +++ b/harbour/contrib/gtwvg/gtwvg.c @@ -82,8 +82,6 @@ * */ -#define HB_OS_WIN_USED - #undef _WIN32_WINNT #define _WIN32_WINNT 0x0500 /* Set to Windows 2000 for WS_EX_LAYERED */ diff --git a/harbour/contrib/gtwvg/gtwvg.h b/harbour/contrib/gtwvg/gtwvg.h index e68f580a28..055de38429 100644 --- a/harbour/contrib/gtwvg/gtwvg.h +++ b/harbour/contrib/gtwvg/gtwvg.h @@ -51,7 +51,6 @@ */ #ifndef HB_WVT_H_ - #define HB_WVT_H_ #define HB_GT_NAME WVG diff --git a/harbour/contrib/gtwvg/wvgcore.c b/harbour/contrib/gtwvg/wvgcore.c index e0e2394a6d..b8497fb4af 100644 --- a/harbour/contrib/gtwvg/wvgcore.c +++ b/harbour/contrib/gtwvg/wvgcore.c @@ -74,10 +74,6 @@ /*----------------------------------------------------------------------*/ /*----------------------------------------------------------------------*/ -#define HB_OS_WIN_USED - -/*----------------------------------------------------------------------*/ - #include "gtwvg.h" #define __SETGUI__ diff --git a/harbour/contrib/gtwvg/wvgcuig.c b/harbour/contrib/gtwvg/wvgcuig.c index 1ad3e60b94..8740e35d5b 100644 --- a/harbour/contrib/gtwvg/wvgcuig.c +++ b/harbour/contrib/gtwvg/wvgcuig.c @@ -82,8 +82,6 @@ /*----------------------------------------------------------------------*/ /*----------------------------------------------------------------------*/ -#define HB_OS_WIN_USED - #include "gtwvg.h" /*----------------------------------------------------------------------*/ diff --git a/harbour/contrib/gtwvg/wvggui.c b/harbour/contrib/gtwvg/wvggui.c index fa121f17d5..ea4d4dcb99 100644 --- a/harbour/contrib/gtwvg/wvggui.c +++ b/harbour/contrib/gtwvg/wvggui.c @@ -82,8 +82,6 @@ * */ -#define HB_OS_WIN_USED - #include "wvggui.h" static int s_GtId; diff --git a/harbour/contrib/gtwvg/wvggui.h b/harbour/contrib/gtwvg/wvggui.h index 551c480065..30e00dd043 100644 --- a/harbour/contrib/gtwvg/wvggui.h +++ b/harbour/contrib/gtwvg/wvggui.h @@ -51,7 +51,6 @@ */ #ifndef HB_WVT_H_ - #define HB_WVT_H_ #define HB_GT_NAME WGU diff --git a/harbour/contrib/gtwvg/wvgutils.c b/harbour/contrib/gtwvg/wvgutils.c index eae2879bdd..8215860644 100644 --- a/harbour/contrib/gtwvg/wvgutils.c +++ b/harbour/contrib/gtwvg/wvgutils.c @@ -66,10 +66,6 @@ /*----------------------------------------------------------------------*/ -#define HB_OS_WIN_USED - -/*----------------------------------------------------------------------*/ - #include "gtwvg.h" /* workaround for missing declaration in MinGW32 */ diff --git a/harbour/contrib/gtwvg/wvgwin.c b/harbour/contrib/gtwvg/wvgwin.c index 56aa74cade..455d298d7b 100644 --- a/harbour/contrib/gtwvg/wvgwin.c +++ b/harbour/contrib/gtwvg/wvgwin.c @@ -74,8 +74,6 @@ /*----------------------------------------------------------------------*/ /*----------------------------------------------------------------------*/ -#define HB_OS_WIN_USED - /* dirty hack for borland C compiler and #define NONAMELESSUNION in oledlg.h */ #if defined( __BORLANDC__ ) # define DUMMYUNIONNAME @@ -87,6 +85,7 @@ #include "gtwvg.h" #include "hbwapi.h" + #include #if !defined( GCLP_HBRBACKGROUND ) diff --git a/harbour/contrib/gtwvg/wvgwing.c b/harbour/contrib/gtwvg/wvgwing.c index 08c5e26ee5..8d18e88593 100644 --- a/harbour/contrib/gtwvg/wvgwing.c +++ b/harbour/contrib/gtwvg/wvgwing.c @@ -74,8 +74,6 @@ /*----------------------------------------------------------------------*/ /*----------------------------------------------------------------------*/ -#define HB_OS_WIN_USED - /* dirty hack for borland C compiler and #define NONAMELESSUNION in oledlg.h */ #if defined( __BORLANDC__ ) # define DUMMYUNIONNAME @@ -87,6 +85,7 @@ #include "gtwvg.h" #include "hbwapi.h" + #include #if !defined( GCLP_HBRBACKGROUND ) diff --git a/harbour/contrib/xhb/bkgtsks.c b/harbour/contrib/xhb/bkgtsks.c index c5b20ca021..6f949d1519 100644 --- a/harbour/contrib/xhb/bkgtsks.c +++ b/harbour/contrib/xhb/bkgtsks.c @@ -58,8 +58,6 @@ * */ -#define HB_OS_WIN_USED - #include "hbapi.h" #include "hbapiitm.h" #include "hbstack.h" diff --git a/harbour/include/clipdefs.h b/harbour/include/clipdefs.h index b103586ee5..5658a2ea78 100644 --- a/harbour/include/clipdefs.h +++ b/harbour/include/clipdefs.h @@ -141,9 +141,7 @@ typedef NEARP * NEARPP; typedef HB_VMHANDLE HANDLE; #endif -#if ! defined( HB_LEGACY_LEVEL2 ) - #define ERRCODE HB_ERRCODE -#endif +#define ERRCODE HB_ERRCODE typedef ERRCODE IHELP; typedef ERRCODE ICODE; diff --git a/harbour/include/hbapi.h b/harbour/include/hbapi.h index 70655000a7..75da0c659c 100644 --- a/harbour/include/hbapi.h +++ b/harbour/include/hbapi.h @@ -475,13 +475,6 @@ typedef unsigned int HB_ERRCODE; #define HB_SUCCESS 0 #define HB_FAILURE 1 -/* Compatibility #defines. Don't use them with new code and in Harbour sources. */ -#ifdef HB_LEGACY_LEVEL2 - #define ERRCODE HB_ERRCODE - #define SUCCESS HB_SUCCESS - #define FAILURE HB_FAILURE -#endif - extern HB_SYMB hb_symEval; extern HB_EXPORT void hb_xinit( void ); /* Initialize fixed memory subsystem */ @@ -592,10 +585,6 @@ extern HB_EXPORT void hb_gcDummyMark( void * Cargo ); /* dummy GC mark func extern PHB_ITEM hb_gcGripGet( HB_ITEM_PTR pItem ); extern void hb_gcGripDrop( HB_ITEM_PTR pItem ); -#ifdef HB_LEGACY_LEVEL2 -extern HB_EXPORT void * hb_gcAlloc( HB_SIZE ulSize, HB_GARBAGE_FUNC_PTR pCleanupFunc ); -#endif - #ifdef _HB_API_INTERNAL_ extern const HB_GC_FUNCS * hb_gcFuncs( void *pBlock ); /* return cleanup function pointer */ extern void hb_gcAttach( void * pBlock ); @@ -703,17 +692,6 @@ extern HB_EXPORT void hb_retnlllen( HB_LONGLONG lNumber, int iWidth ); /* retu #define HB_IS_VALID_INDEX( idx, max ) ( (idx) > 0 && ( HB_ULONG ) (idx) <= (max) ) -#ifdef HB_LEGACY_LEVEL2 - /* xHarbour compatible functions */ - #define hb_retcAdopt( szText ) hb_retc_buffer( (szText) ) - #define hb_retclenAdopt( szText, ulLen ) hb_retclen_buffer( (szText), (ulLen) ) - #define hb_retcStatic( szText ) hb_retc_const( (szText) ) - #define hb_storclenAdopt hb_storclen_buffer - #define hb_itemPutCRawStatic hb_itemPutCLConst - /* compatibility with older Harbour */ - #define hb_arraySetCPtr hb_arraySetCLPtr -#endif - #ifdef HB_API_MACROS #define hb_pcount() ( ( int ) ( hb_stackBaseItem() )->item.asSymbol.paramcnt ) @@ -1025,9 +1003,8 @@ extern HB_BOOL hb_cmdargCheck( const char * pszName ); /* Check if a given extern char * hb_cmdargString( const char * pszName ); /* Returns the string value of an internal switch (like //TEMPPATH:"C:\") */ extern int hb_cmdargNum( const char * pszName ); /* Returns the numeric value of an internal switch (like //F:90) */ extern HB_ULONG hb_cmdargProcessVM( int*, int* ); /* Check for command line internal arguments */ -#if defined( HB_OS_WIN ) && defined( HB_OS_WIN_USED ) -extern HB_EXPORT void hb_winmainArgInit( HANDLE hInstance, HANDLE hPrevInstance, int iCmdShow ); /* Set WinMain() parameters */ -extern HB_EXPORT HB_BOOL hb_winmainArgGet( HANDLE * phInstance, HANDLE * phPrevInstance, int * piCmdShow ); /* Retrieve WinMain() parameters */ +#if defined( HB_OS_WIN ) +extern HB_EXPORT HB_BOOL hb_winmainArgGet( void * phInstance, void * phPrevInstance, int * piCmdShow ); /* Retrieve WinMain() parameters */ #endif /* Codeblock management */ diff --git a/harbour/include/hbapicdp.h b/harbour/include/hbapicdp.h index df09d89e1f..e6a9d297bc 100644 --- a/harbour/include/hbapicdp.h +++ b/harbour/include/hbapicdp.h @@ -386,11 +386,6 @@ extern HB_EXPORT HB_BOOL hb_cdpUTF8ToU16NextChar( HB_UCHAR ucChar, int * n, extern HB_EXPORT PHB_ITEM hb_itemDeserializeCP( const char ** pBufferPtr, HB_SIZE * pulSize, PHB_CODEPAGE cdpIn, PHB_CODEPAGE cdpOut ); extern HB_EXPORT char * hb_itemSerializeCP( PHB_ITEM pItem, HB_BOOL fNumSize, PHB_CODEPAGE cdpIn, PHB_CODEPAGE cdpOut, HB_SIZE * pulSize ); -#ifdef HB_LEGACY_LEVEL2 -extern HB_EXPORT void hb_cdpTranslate( char *, PHB_CODEPAGE, PHB_CODEPAGE ); -extern HB_EXPORT void hb_cdpnTranslate( char *, PHB_CODEPAGE, PHB_CODEPAGE, HB_SIZE ); -#endif - HB_EXTERN_END #endif /* HB_APICDP_H_ */ diff --git a/harbour/include/hbapiitm.h b/harbour/include/hbapiitm.h index 5100cd4614..26ba06bc10 100644 --- a/harbour/include/hbapiitm.h +++ b/harbour/include/hbapiitm.h @@ -222,12 +222,6 @@ extern HB_EXPORT PHB_ITEM hb_itemDeserialize( const char ** pBufferPtr, HB_S #endif /* _HB_API_INTERNAL_ */ -#ifdef HB_LEGACY_LEVEL2 - /* xHarbour compatible function */ - #define hb_itemForwardValue( dst, src ) hb_itemMove( (dst), (src) ) - #define hb_itemPutCStatic( itm, str ) hb_itemPutCConst( (itm), (str) ) -#endif - HB_EXTERN_END #endif /* HB_APIITM_H_ */ diff --git a/harbour/include/hbdefs.h b/harbour/include/hbdefs.h index 57dc12b692..0e49c86743 100644 --- a/harbour/include/hbdefs.h +++ b/harbour/include/hbdefs.h @@ -62,13 +62,6 @@ #include "hbsetup.h" #include "hbver.h" -/* Compatibility. Do not use HB_OS_WIN_32_USED anymore. */ -#ifdef HB_LEGACY_LEVEL2 - #if defined( HB_OS_WIN_32_USED ) && ! defined( HB_OS_WIN_USED ) - #define HB_OS_WIN_USED - #endif -#endif - #if defined( __XCC__ ) || defined( __POCC__ ) || defined( __LCC__ ) || \ defined( __MINGW32__ ) || defined( __DMC__ ) || \ ( defined( __BORLANDC__ ) && __BORLANDC__ >= 1410 ) || \ @@ -110,21 +103,26 @@ #if !defined( HB_IO_WIN_OFF ) #define HB_IO_WIN #endif - #if defined( HB_IO_WIN ) && !defined( HB_OS_WIN_USED ) - /* disabled to avoid problems with windows.h */ - /* #define HB_OS_WIN_USED */ - #endif #else #undef HB_IO_WIN #undef HB_OS_WIN_USED #endif /* Include windows.h if applicable and requested */ -#if defined( HB_OS_WIN_USED ) && defined( HB_OS_WIN ) +#if defined( HB_OS_WIN ) - #include - #if defined( __GNUC__ ) - #define HB_DONT_DEFINE_BASIC_TYPES + #if defined( HB_OS_WIN_USED ) + + #include + #if defined( __GNUC__ ) + #define HB_DONT_DEFINE_BASIC_TYPES + #endif + #else + /* Autodetect windows header. We need this information + in a few places in headers. */ + #if defined( _WINDOWS_ ) || defined( _WINDOWS_H ) + #define HB_OS_WIN_USED + #endif #endif #elif defined( HB_OS_OS2 ) @@ -1575,7 +1573,48 @@ typedef HB_U32 HB_FATTR; #endif #if defined( HB_OS_WIN ) - #include "hbwince.h" + + #if defined( HB_OS_WIN_CE ) && defined( HB_OS_WIN_USED ) + #include "hbwince.h" + #endif + + /* Features provided for Windows builds only */ + + extern HB_EXPORT wchar_t * hb_mbtowc( const char * srcA ); + extern HB_EXPORT char * hb_wctomb( const wchar_t * srcW ); + extern HB_EXPORT wchar_t * hb_mbntowc( const char * srcA, HB_SIZE ulLen ); + extern HB_EXPORT char * hb_wcntomb( const wchar_t * srcW, HB_SIZE ulLen ); + extern HB_EXPORT void hb_mbtowccpy( wchar_t * dstW, const char * srcA, HB_SIZE ulLen ); + extern HB_EXPORT void hb_mbtowcset( wchar_t * dstW, const char * srcA, HB_SIZE ulLen ); + extern HB_EXPORT void hb_wctombget( char * dstA, const wchar_t * srcW, HB_SIZE ulLen ); + + #if defined( HB_OS_WIN_CE ) + #define HBTEXT( x ) TEXT( x ) + #else + #define HBTEXT( x ) x + #endif + + #if defined( UNICODE ) + #define HB_TCHAR_CPTO(d,s,l) hb_mbtowccpy(d,s,l) + #define HB_TCHAR_GETFROM(d,s,l) hb_wctombget(d,s,l) + #define HB_TCHAR_SETTO(d,s,l) hb_mbtowcset(d,s,l) + #define HB_TCHAR_CONVTO(s) hb_mbtowc(s) + #define HB_TCHAR_CONVFROM(s) hb_wctomb(s) + #define HB_TCHAR_CONVNTO(s,l) hb_mbntowc(s,l) + #define HB_TCHAR_CONVNFROM(s,l) hb_wcntomb(s,l) + #define HB_TCHAR_CONVNREV(d,s,l) do { hb_wctombget(d,s,l); hb_xfree(s); } while( 0 ) + #define HB_TCHAR_FREE(s) hb_xfree(s) + #else + #define HB_TCHAR_CPTO(d,s,l) hb_strncpy(d,s,l) + #define HB_TCHAR_SETTO(d,s,l) memcpy(d,s,l) + #define HB_TCHAR_GETFROM(d,s,l) memcpy(d,s,l) + #define HB_TCHAR_CONVTO(s) ((char *)(s)) + #define HB_TCHAR_CONVFROM(s) ((char *)(s)) + #define HB_TCHAR_CONVNTO(s,l) ((char *)(s)) + #define HB_TCHAR_CONVNFROM(s,l) ((char *)(s)) + #define HB_TCHAR_CONVNREV(d,s,l) do { ; } while( 0 ) + #define HB_TCHAR_FREE(s) HB_SYMBOL_UNUSED(s) + #endif #endif /* Function declaration macros */ diff --git a/harbour/include/hbextern.ch b/harbour/include/hbextern.ch index 7e0ce32936..4a03a26ae5 100644 --- a/harbour/include/hbextern.ch +++ b/harbour/include/hbextern.ch @@ -841,9 +841,6 @@ EXTERNAL HB_CDPLIST EXTERNAL HB_CDPUNIID EXTERNAL HB_CDPINFO EXTERNAL HB_CDPSELECT -#ifdef HB_LEGACY_LEVEL2 -EXTERNAL HB_SETCODEPAGE -#endif EXTERNAL HB_TRANSLATE EXTERNAL HB_STRTOUTF8 EXTERNAL HB_UTF8TOSTR diff --git a/harbour/include/hbsetup.h b/harbour/include/hbsetup.h index 92f1eabfd6..cb3de5e1eb 100644 --- a/harbour/include/hbsetup.h +++ b/harbour/include/hbsetup.h @@ -154,12 +154,6 @@ */ /* #define HB_PP_MULTILINE_STRING */ -#ifdef HB_LEGACY_LEVEL2 - #ifndef _POSIX_PATH_MAX - #define _POSIX_PATH_MAX 255 - #endif -#endif - /* NOTE: Compiler _MSC_VER value -------- -------------- @@ -222,10 +216,6 @@ #ifndef HB_OS_WIN #if defined( WINNT ) || defined( _Windows ) || defined( __NT__ ) || defined( _WIN32 ) || defined( _WINDOWS_ ) || defined( __WINDOWS_386__ ) || defined( __WIN32__ ) || defined( __CYGWIN__ ) #define HB_OS_WIN - /* Compatibility. Do not use this. */ - #ifdef HB_LEGACY_LEVEL2 - #define HB_OS_WIN_32 - #endif #endif #endif @@ -240,10 +230,6 @@ #ifndef HB_OS_WIN_CE #if defined( _WINCE ) || defined( __CEGCC__ ) || defined( __MINGW32CE__ ) #define HB_OS_WIN_CE - /* Compatibility. Do not use this. */ - #ifdef HB_LEGACY_LEVEL2 - #define HB_WINCE - #endif #endif #endif @@ -293,10 +279,6 @@ defined( HB_OS_HPUX ) || \ defined( HB_OS_BEOS ) #define HB_OS_UNIX - /* Compatibility. Do not use this. */ - #ifdef HB_LEGACY_LEVEL2 - #define HB_OS_UNIX_COMPATIBLE - #endif #endif #endif @@ -322,7 +304,11 @@ #define HB_OS_PATH_DELIM_CHR_LIST "\\/:" #define HB_OS_ALLFILE_MASK "*.*" #define HB_OS_DRIVE_DELIM_CHR ':' - #define HB_OS_HAS_DRIVE_LETTER + #if defined( HB_OS_WIN_CE ) + #undef HB_OS_HAS_DRIVE_LETTER + #else + #define HB_OS_HAS_DRIVE_LETTER + #endif #define HB_OS_EOL_LEN 2 /* # of bytes in End of Line marker */ #define HB_OS_OPT_DELIM_LIST "/-" #define HB_ISOPTSEP( c ) ( ( c ) == '-' || ( c ) == '/' ) diff --git a/harbour/include/hbwince.h b/harbour/include/hbwince.h index f4f5ae1230..74a078e047 100644 --- a/harbour/include/hbwince.h +++ b/harbour/include/hbwince.h @@ -53,166 +53,117 @@ #ifndef HB_WINCE_H_ #define HB_WINCE_H_ -#if defined( HB_OS_WIN ) +/* This file requires already #included */ + +#if defined( HB_OS_WIN ) && defined( HB_OS_WIN_CE ) && defined( HB_OS_WIN_USED ) HB_EXTERN_BEGIN -#if defined( HB_OS_WIN_CE ) -# undef HB_OS_HAS_DRIVE_LETTER - -/* defined( __CEGCC__ ) || defined( __MINGW32CE__ ) */ - -#if defined( HB_OS_WIN_USED ) - - #if defined( _MSC_VER ) - #ifndef MAX_COMPUTERNAME_LENGTH - #define MAX_COMPUTERNAME_LENGTH 31 - #define SEM_FAILCRITICALERRORS 0x0001 - #define FILE_TYPE_CHAR 0x0002 - #define STD_INPUT_HANDLE ((DWORD)-10) - #define STD_OUTPUT_HANDLE ((DWORD)-11) - #define STD_ERROR_HANDLE ((DWORD)-12) - #define LOCKFILE_FAIL_IMMEDIATELY 0x00000001 - #define LOCKFILE_EXCLUSIVE_LOCK 0x00000002 - #define OEM_FIXED_FONT SYSTEM_FONT - #define WM_NCMOUSEMOVE 0x00A0 - #define WM_QUERYENDSESSION 0x0011 - #define WM_ENTERIDLE 0x0121 - #define SM_CMOUSEBUTTONS 43 - #define PROOF_QUALITY 2 - #define LR_LOADFROMFILE 0x0010 - #ifndef DRIVE_UNKNOWN - #define DRIVE_UNKNOWN 0 - #endif - #endif - - BOOL WINAPI GetProcessTimes( HANDLE hprocess, - LPFILETIME lpCreationTime, LPFILETIME lpExitTime, - LPFILETIME lpKernelTime, LPFILETIME lpUserTime ); - BOOL WINAPI LockFile( HANDLE hFile, - DWORD dwFileOffsetLow, DWORD dwFileOffsetHigh, - DWORD nNumberOfBytesToLockLow, DWORD nNumberOfBytesToLockHigh ); - BOOL WINAPI LockFileEx( HANDLE hFile, - DWORD dwFlags, DWORD dwReserved, - DWORD nNumberOfBytesToLockLow, - DWORD nNumberOfBytesToLockHigh, LPOVERLAPPED lpOverlapped ); - BOOL WINAPI UnlockFile( HANDLE hFile, - DWORD dwFileOffsetLow, DWORD dwFileOffsetHigh, - DWORD nNumberOfBytesToUnlockLow, DWORD nNumberOfBytesToUnlockHigh ); - BOOL WINAPI UnlockFileEx( HANDLE hFile, DWORD dwReserved, - DWORD nNumberOfBytesToUnlockLow, - DWORD nNumberOfBytesToUnlockHigh, LPOVERLAPPED lpOverlapped ); - UINT WINAPI SetErrorMode( UINT mode ); - HANDLE WINAPI GetStdHandle( DWORD nStdHandle ); - DWORD WINAPI GetFileType( HANDLE handle ); - BOOL WINAPI Beep( DWORD dwFreq, DWORD dwDurat ); - int WINAPI SetTextCharacterExtra( HDC hdc, int i ); - BOOL WINAPI GetKeyboardState( PBYTE p ); - BOOL WINAPI SetKeyboardState( PBYTE p ); - - int WINAPI FrameRect( HDC hDC, CONST RECT * lprc, HBRUSH hbr ); - BOOL WINAPI FloodFill( HDC hdc, int x, int y, COLORREF color); - BOOL WINAPI Arc( HDC hdc, int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4); - #endif /* _MSC_VER */ - - #if defined( __POCC__ ) || defined( __XCC__ ) - #ifndef GlobalAlloc - #define GlobalAlloc(flags, cb) LocalAlloc(flags, cb) - #endif - #ifndef GlobalLock - #define GlobalLock(lp) LocalLock(lp) - #endif - #ifndef GlobalUnlock - #define GlobalUnlock(lp) LocalUnlock(lp) - #endif - #ifndef GlobalSize - #define GlobalSize(lp) LocalSize(lp) - #endif - #ifndef GlobalFree - #define GlobalFree(h) LocalFree(h) - #endif - #ifndef GlobalReAlloc - #define GlobalReAlloc(h, cb, flags) LocalReAlloc(h, cb, flags) - #endif - #ifndef GlobalHandle - #define GlobalHandle(lp) LocalHandle(lp) - #endif - #ifndef GlobalFlags - #define GlobalFlags(lp) LocalFlags(lp) +#if defined( _MSC_VER ) + #ifndef MAX_COMPUTERNAME_LENGTH + #define MAX_COMPUTERNAME_LENGTH 31 + #define SEM_FAILCRITICALERRORS 0x0001 + #define FILE_TYPE_CHAR 0x0002 + #define STD_INPUT_HANDLE ((DWORD)-10) + #define STD_OUTPUT_HANDLE ((DWORD)-11) + #define STD_ERROR_HANDLE ((DWORD)-12) + #define LOCKFILE_FAIL_IMMEDIATELY 0x00000001 + #define LOCKFILE_EXCLUSIVE_LOCK 0x00000002 + #define OEM_FIXED_FONT SYSTEM_FONT + #define WM_NCMOUSEMOVE 0x00A0 + #define WM_QUERYENDSESSION 0x0011 + #define WM_ENTERIDLE 0x0121 + #define SM_CMOUSEBUTTONS 43 + #define PROOF_QUALITY 2 + #define LR_LOADFROMFILE 0x0010 + #ifndef DRIVE_UNKNOWN + #define DRIVE_UNKNOWN 0 #endif #endif - #if !defined( GetEnvironmentVariable ) - DWORD WINAPI GetEnvironmentVariableW( LPCWSTR name, LPWSTR value, DWORD size ); - #define GetEnvironmentVariable GetEnvironmentVariableW - #endif - #if !defined( SetEnvironmentVariable ) - BOOL WINAPI SetEnvironmentVariableW( LPCWSTR name, LPCWSTR value ); - #define SetEnvironmentVariable SetEnvironmentVariableW - #endif - #if !defined( SetCurrentDirectory ) - BOOL WINAPI SetCurrentDirectoryW( LPCWSTR dirname ); - #define SetCurrentDirectory SetCurrentDirectoryW - #endif - #if !defined( GetCurrentDirectory ) - DWORD WINAPI GetCurrentDirectoryW( DWORD len, LPWSTR buffer ); - #define GetCurrentDirectory GetCurrentDirectoryW - #endif - #if !defined( GetComputerName ) - BOOL WINAPI GetComputerNameW( LPWSTR buffer, LPDWORD len ); - #define GetComputerName GetComputerNameW - #endif - #if !defined( GetUserName ) - BOOL WINAPI GetUserNameW( LPWSTR buffer, LPDWORD len ); - #define GetUserName GetUserNameW - #endif + BOOL WINAPI GetProcessTimes( HANDLE hprocess, + LPFILETIME lpCreationTime, LPFILETIME lpExitTime, + LPFILETIME lpKernelTime, LPFILETIME lpUserTime ); + BOOL WINAPI LockFile( HANDLE hFile, + DWORD dwFileOffsetLow, DWORD dwFileOffsetHigh, + DWORD nNumberOfBytesToLockLow, DWORD nNumberOfBytesToLockHigh ); + BOOL WINAPI LockFileEx( HANDLE hFile, + DWORD dwFlags, DWORD dwReserved, + DWORD nNumberOfBytesToLockLow, + DWORD nNumberOfBytesToLockHigh, LPOVERLAPPED lpOverlapped ); + BOOL WINAPI UnlockFile( HANDLE hFile, + DWORD dwFileOffsetLow, DWORD dwFileOffsetHigh, + DWORD nNumberOfBytesToUnlockLow, DWORD nNumberOfBytesToUnlockHigh ); + BOOL WINAPI UnlockFileEx( HANDLE hFile, DWORD dwReserved, + DWORD nNumberOfBytesToUnlockLow, + DWORD nNumberOfBytesToUnlockHigh, LPOVERLAPPED lpOverlapped ); + UINT WINAPI SetErrorMode( UINT mode ); + HANDLE WINAPI GetStdHandle( DWORD nStdHandle ); + DWORD WINAPI GetFileType( HANDLE handle ); + BOOL WINAPI Beep( DWORD dwFreq, DWORD dwDurat ); + int WINAPI SetTextCharacterExtra( HDC hdc, int i ); + BOOL WINAPI GetKeyboardState( PBYTE p ); + BOOL WINAPI SetKeyboardState( PBYTE p ); -#endif /* HB_OS_WIN_USED */ + int WINAPI FrameRect( HDC hDC, CONST RECT * lprc, HBRUSH hbr ); + BOOL WINAPI FloodFill( HDC hdc, int x, int y, COLORREF color); + BOOL WINAPI Arc( HDC hdc, int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4); +#endif /* _MSC_VER */ -#endif /* HB_OS_WIN_CE */ - -extern HB_EXPORT wchar_t * hb_mbtowc( const char *srcA ); -extern HB_EXPORT char * hb_wctomb( const wchar_t *srcW ); -extern HB_EXPORT wchar_t * hb_mbntowc( const char *srcA, HB_SIZE ulLen ); -extern HB_EXPORT char * hb_wcntomb( const wchar_t *srcW, HB_SIZE ulLen ); -extern HB_EXPORT void hb_mbtowccpy( wchar_t *dstW, const char *srcA, HB_SIZE ulLen ); -extern HB_EXPORT void hb_mbtowcset( wchar_t *dstW, const char *srcA, HB_SIZE ulLen ); -extern HB_EXPORT void hb_wctombget( char *dstA, const wchar_t *srcW, HB_SIZE ulLen ); - -#if defined( HB_OS_WIN_CE ) - #define HBTEXT( x ) TEXT( x ) -#else - #define HBTEXT( x ) x +#if defined( __POCC__ ) || defined( __XCC__ ) + #ifndef GlobalAlloc + #define GlobalAlloc(flags, cb) LocalAlloc(flags, cb) + #endif + #ifndef GlobalLock + #define GlobalLock(lp) LocalLock(lp) + #endif + #ifndef GlobalUnlock + #define GlobalUnlock(lp) LocalUnlock(lp) + #endif + #ifndef GlobalSize + #define GlobalSize(lp) LocalSize(lp) + #endif + #ifndef GlobalFree + #define GlobalFree(h) LocalFree(h) + #endif + #ifndef GlobalReAlloc + #define GlobalReAlloc(h, cb, flags) LocalReAlloc(h, cb, flags) + #endif + #ifndef GlobalHandle + #define GlobalHandle(lp) LocalHandle(lp) + #endif + #ifndef GlobalFlags + #define GlobalFlags(lp) LocalFlags(lp) + #endif #endif -#if defined( UNICODE ) - - #define HB_TCHAR_CPTO(d,s,l) hb_mbtowccpy(d,s,l) - #define HB_TCHAR_GETFROM(d,s,l) hb_wctombget(d,s,l) - #define HB_TCHAR_SETTO(d,s,l) hb_mbtowcset(d,s,l) - #define HB_TCHAR_CONVTO(s) hb_mbtowc(s) - #define HB_TCHAR_CONVFROM(s) hb_wctomb(s) - #define HB_TCHAR_CONVNTO(s,l) hb_mbntowc(s,l) - #define HB_TCHAR_CONVNFROM(s,l) hb_wcntomb(s,l) - #define HB_TCHAR_CONVNREV(d,s,l) do { hb_wctombget(d,s,l); hb_xfree(s); } while( 0 ) - #define HB_TCHAR_FREE(s) hb_xfree(s) - -#else - - #define HB_TCHAR_CPTO(d,s,l) hb_strncpy(d,s,l) - #define HB_TCHAR_SETTO(d,s,l) memcpy(d,s,l) - #define HB_TCHAR_GETFROM(d,s,l) memcpy(d,s,l) - #define HB_TCHAR_CONVTO(s) ((char *)(s)) - #define HB_TCHAR_CONVFROM(s) ((char *)(s)) - #define HB_TCHAR_CONVNTO(s,l) ((char *)(s)) - #define HB_TCHAR_CONVNFROM(s,l) ((char *)(s)) - #define HB_TCHAR_CONVNREV(d,s,l) do { ; } while( 0 ) - #define HB_TCHAR_FREE(s) HB_SYMBOL_UNUSED(s) - -#endif /* UNICODE */ +#if !defined( GetEnvironmentVariable ) + DWORD WINAPI GetEnvironmentVariableW( LPCWSTR name, LPWSTR value, DWORD size ); + #define GetEnvironmentVariable GetEnvironmentVariableW +#endif +#if !defined( SetEnvironmentVariable ) + BOOL WINAPI SetEnvironmentVariableW( LPCWSTR name, LPCWSTR value ); + #define SetEnvironmentVariable SetEnvironmentVariableW +#endif +#if !defined( SetCurrentDirectory ) + BOOL WINAPI SetCurrentDirectoryW( LPCWSTR dirname ); + #define SetCurrentDirectory SetCurrentDirectoryW +#endif +#if !defined( GetCurrentDirectory ) + DWORD WINAPI GetCurrentDirectoryW( DWORD len, LPWSTR buffer ); + #define GetCurrentDirectory GetCurrentDirectoryW +#endif +#if !defined( GetComputerName ) + BOOL WINAPI GetComputerNameW( LPWSTR buffer, LPDWORD len ); + #define GetComputerName GetComputerNameW +#endif +#if !defined( GetUserName ) + BOOL WINAPI GetUserNameW( LPWSTR buffer, LPDWORD len ); + #define GetUserName GetUserNameW +#endif HB_EXTERN_END -#endif /* HB_OS_WIN */ +#endif #endif /* HB_WINCE_H_ */ diff --git a/harbour/include/hbwmain.c b/harbour/include/hbwmain.c index ae12c70407..e21c92fff6 100644 --- a/harbour/include/hbwmain.c +++ b/harbour/include/hbwmain.c @@ -63,6 +63,10 @@ static char * s_argv[ HB_MAX_ARGS ]; # define HB_LPSTR LPSTR #endif +#if defined( HB_VM_STARTUP ) +extern void hb_winmainArgInit( HANDLE hInstance, HANDLE hPrevInstance, int iCmdShow ); /* Set WinMain() parameters */ +#endif + int WINAPI WinMain( HINSTANCE hInstance, /* handle to current instance */ HINSTANCE hPrevInstance, /* handle to previous instance */ HB_LPSTR lpCmdLine, /* pointer to command line */ diff --git a/harbour/include/rdd.api b/harbour/include/rdd.api index 44852eb44d..424862368f 100644 --- a/harbour/include/rdd.api +++ b/harbour/include/rdd.api @@ -59,10 +59,8 @@ #include "hbapirdd.h" #include "item.api" -#ifndef HB_LEGACY_LEVEL2 - #define SUCCESS HB_SUCCESS - #define FAILURE HB_FAILURE -#endif +#define SUCCESS HB_SUCCESS +#define FAILURE HB_FAILURE #define _rddInherit hb_rddInherit #if 0 diff --git a/harbour/src/rdd/dbcmd.c b/harbour/src/rdd/dbcmd.c index be58dc4142..24d817e8c3 100644 --- a/harbour/src/rdd/dbcmd.c +++ b/harbour/src/rdd/dbcmd.c @@ -2056,16 +2056,6 @@ HB_FUNC( HB_RDDGETTEMPALIAS ) hb_retc( szAliasTmp ); } -#ifdef HB_LEGACY_LEVEL2 - -/* NOTE: Left here for compatibility with previous Harbour versions. */ -HB_FUNC( __RDDGETTEMPALIAS ) -{ - HB_FUNC_EXEC( HB_RDDGETTEMPALIAS ) -} - -#endif - HB_FUNC( HB_RDDINFO ) { LPRDDNODE pRDDNode; diff --git a/harbour/src/rtl/cdpapi.c b/harbour/src/rtl/cdpapi.c index 579b7726bf..7aa9c61f40 100644 --- a/harbour/src/rtl/cdpapi.c +++ b/harbour/src/rtl/cdpapi.c @@ -2106,38 +2106,6 @@ const char * hb_cdpSelectID( const char * id ) return idOld; } -#ifdef HB_LEGACY_LEVEL2 -void hb_cdpnTranslate( char * psz, PHB_CODEPAGE cdpIn, PHB_CODEPAGE cdpOut, HB_SIZE nChars ) -{ - if( cdpIn && cdpOut && cdpIn->uniTable != cdpOut->uniTable ) - { - HB_SIZE ulDst = nChars; - char * pDst = psz; - - if( cdpOut == &s_utf8_codepage || cdpOut->nMultiUC ) - { - ulDst = hb_cdpTransLen( psz, nChars, 0, cdpIn, cdpOut ); - pDst = ( char * ) hb_xgrab( ulDst ); - } - ulDst = hb_cdpTransTo( psz, nChars, pDst, ulDst, cdpIn, cdpOut ); - if( psz != pDst ) - { - if( ulDst > nChars ) - ulDst = nChars; - memcpy( psz, pDst, ulDst ); - hb_xfree( pDst ); - } - if( ulDst < nChars ) - memset( psz + ulDst, '\0', nChars - ulDst ); - } -} - -void hb_cdpTranslate( char * psz, PHB_CODEPAGE cdpIn, PHB_CODEPAGE cdpOut ) -{ - hb_cdpnTranslate( psz, cdpIn, cdpOut, strlen( psz ) ); -} -#endif - /* TOFIX: Move this to cdpapihb.c */ HB_FUNC( HB_CDPLIST ) { diff --git a/harbour/src/rtl/cdpapihb.c b/harbour/src/rtl/cdpapihb.c index b6cc2bc515..111988ed12 100644 --- a/harbour/src/rtl/cdpapihb.c +++ b/harbour/src/rtl/cdpapihb.c @@ -124,15 +124,6 @@ HB_FUNC( __NATSORTVER ) HB_FUNC_EXEC( HB_CDPINFO ); } -#ifdef HB_LEGACY_LEVEL2 - -HB_FUNC( HB_SETCODEPAGE ) -{ - HB_FUNC_EXEC( HB_CDPSELECT ); -} - -#endif - /* * extended CP PRG functions */ diff --git a/harbour/src/vm/classes.c b/harbour/src/vm/classes.c index 4d85887602..04133caf91 100644 --- a/harbour/src/vm/classes.c +++ b/harbour/src/vm/classes.c @@ -5050,62 +5050,6 @@ void hb_clsAssociate( HB_USHORT usClassH ) hb_itemReturnRelease( pSelf ); } -#ifdef HB_LEGACY_LEVEL2 -/* - * __CLS_PARAM() and __CLS_PAR00() functions are only for backward binary - * compatibility. They will be removed in the future so please do not use - * them. - */ -HB_FUNC( __CLS_PARAM ) -{ - HB_STACK_TLS_PRELOAD - PHB_ITEM array; - HB_USHORT uiParam = ( HB_USHORT ) hb_pcount(); - HB_USHORT n; - - if( uiParam >= 1 ) - { - array = hb_itemArrayNew( uiParam ); - for( n = 1; n <= uiParam; n++ ) - hb_arraySet( array, n, hb_param( n, HB_IT_ANY ) ); - } - else - { - array = hb_itemArrayNew( 1 ); - hb_arraySetC( array, 1, "HBObject" ); - } - - hb_itemReturnRelease( array ); -} - -HB_FUNC( __CLS_PAR00 ) -{ - HB_STACK_TLS_PRELOAD - PHB_ITEM array; - HB_USHORT uiParam = ( HB_USHORT ) hb_pcount(); - HB_USHORT n; - - array = hb_itemArrayNew( uiParam ); - for( n = 1; n <= uiParam; n++ ) - hb_arraySet( array, n, hb_param( n, HB_IT_ANY ) ); - - hb_itemReturnRelease( array ); -} - -/* - * This function is only for backward binary compatibility - * It will be removed in the future so please do not use it. - * Use hb_objHasMessage() instead. - */ -#if defined( __cplusplus ) - extern "C" HB_BOOL hb_objGetpMethod( PHB_ITEM pObject, PHB_SYMB pMessage ); -#endif -HB_BOOL hb_objGetpMethod( PHB_ITEM pObject, PHB_SYMB pMessage ) -{ - return hb_objHasMessage( pObject, pMessage->pDynSym ); -} -#endif - #if 0 /* * return real function name ignoring aliasing diff --git a/harbour/src/vm/cmdarg.c b/harbour/src/vm/cmdarg.c index bfb50ac225..4b4ade068f 100644 --- a/harbour/src/vm/cmdarg.c +++ b/harbour/src/vm/cmdarg.c @@ -83,12 +83,12 @@ void hb_winmainArgInit( HANDLE hInstance, HANDLE hPrevInstance, int iCmdShow ) s_WinMainParam = HB_TRUE; } -HB_BOOL hb_winmainArgGet( HANDLE * phInstance, HANDLE * phPrevInstance, int * piCmdShow ) +HB_BOOL hb_winmainArgGet( void * phInstance, void * phPrevInstance, int * piCmdShow ) { if( phInstance ) - *phInstance = s_hInstance; + *( ( HANDLE * ) phInstance ) = s_hInstance; if( phPrevInstance ) - *phPrevInstance = s_hPrevInstance; + *( ( HANDLE * ) phPrevInstance ) = s_hPrevInstance; if( piCmdShow ) *piCmdShow = s_iCmdShow; diff --git a/harbour/src/vm/garbage.c b/harbour/src/vm/garbage.c index 24f9817847..6e6453b01b 100644 --- a/harbour/src/vm/garbage.c +++ b/harbour/src/vm/garbage.c @@ -750,62 +750,6 @@ void hb_gcCollectAll( HB_BOOL fForce ) } } -#ifdef HB_LEGACY_LEVEL2 -typedef struct _HB_GC_ALLOC_FUNCS -{ - HB_GC_FUNCS funcs; - struct _HB_GC_ALLOC_FUNCS * pNext; -} HB_GC_ALLOC_FUNCS; - -static HB_GC_ALLOC_FUNCS * s_pAllocFuncs = NULL; - -static void hb_gcAllocExit( void ) -{ - while( s_pAllocFuncs ) - { - HB_GC_ALLOC_FUNCS * pFuncs = s_pAllocFuncs; - s_pAllocFuncs = pFuncs->pNext; - hb_xfree( pFuncs ); - } -} - -void * hb_gcAlloc( HB_SIZE ulSize, HB_GARBAGE_FUNC_PTR pCleanupFunc ) -{ - HB_GC_ALLOC_FUNCS * pFuncs = s_pAllocFuncs, ** pFuncsPtr; - - while( pFuncs ) - { - if( pFuncs->funcs.clear == pCleanupFunc ) - break; - pFuncs = pFuncs->pNext; - } - - if( !pFuncs ) - { - pFuncs = ( HB_GC_ALLOC_FUNCS * ) hb_xgrab( sizeof( HB_GC_ALLOC_FUNCS ) ); - pFuncs->funcs.clear = pCleanupFunc; - pFuncs->funcs.mark = hb_gcDummyMark; - pFuncs->pNext = NULL; - HB_GC_LOCK - pFuncsPtr = &s_pAllocFuncs; - while( *pFuncsPtr ) - { - if( ( *pFuncsPtr )->funcs.clear == pCleanupFunc ) - { - hb_xfree( pFuncs ); - pFuncs = *pFuncsPtr; - break; - } - pFuncsPtr = &( *pFuncsPtr )->pNext; - } - if( *pFuncsPtr == NULL ) - *pFuncsPtr = pFuncs; - HB_GC_UNLOCK - } - - return hb_gcAllocate( ulSize, &pFuncs->funcs ); -} -#endif /* MTNOTE: It's executed at the end of HVM cleanup code just before * application exit when other threads are destroyed, so it @@ -842,10 +786,6 @@ void hb_gcReleaseAll( void ) } s_bCollecting = HB_FALSE; - -#ifdef HB_LEGACY_LEVEL2 - hb_gcAllocExit(); -#endif } /* service a single garbage collector step diff --git a/harbour/src/vm/runner.c b/harbour/src/vm/runner.c index fdbe881c1d..016880e424 100644 --- a/harbour/src/vm/runner.c +++ b/harbour/src/vm/runner.c @@ -191,7 +191,6 @@ static void hb_hrbInitStatic( PHRB_BODY pHrbBody ) hb_vmPushSymbol( &(pHrbBody->pSymRead[ ul ]) ); hb_vmPushNil(); hb_vmProc( 0 ); - } } } @@ -841,34 +840,3 @@ HB_FUNC( HB_HRBGETFUNSYM ) else hb_errRT_BASE( EG_ARG, 6106, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } - -/* NOTE: Deprecated compatibility functions. */ - -#ifdef HB_LEGACY_LEVEL2 - -HB_FUNC( __HRBRUN ) -{ - HB_FUNC_EXEC( HB_HRBRUN ); -} - -HB_FUNC( __HRBLOAD ) -{ - HB_FUNC_EXEC( HB_HRBLOAD ); -} - -HB_FUNC( __HRBUNLOAD ) -{ - HB_FUNC_EXEC( HB_HRBUNLOAD ); -} - -HB_FUNC( __HRBDO ) -{ - HB_FUNC_EXEC( HB_HRBDO ); -} - -HB_FUNC( __HRBGETFU ) -{ - HB_FUNC_EXEC( HB_HRBGETFUNSYM ); -} - -#endif