2009-11-30 16:51 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)

* harbour/bin/hb-func.sh
    - removed not longer working HB_DB_DRVEXT
    + added HB_USER_DLL_ADDONS which can be used to activate rebuilding
      Harbour shared library in postinst phase with additional libraries
      specified by user in above envvar - it's not officially supported
      functionality but temporary workaround until we will not add some
      more generic support for above feature so I do not document it in
      INSTALL

  * harbour/contrib/hbwin/olecore.c
    + added support for conversion safe arrays with any type variants
      to Harbour - please test
This commit is contained in:
Przemyslaw Czerpak
2009-11-30 15:52:00 +00:00
parent c9efa2953f
commit f56d654c63
3 changed files with 75 additions and 41 deletions

View File

@@ -17,6 +17,20 @@
past entries belonging to author(s): Viktor Szakats.
*/
2009-11-30 16:51 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/bin/hb-func.sh
- removed not longer working HB_DB_DRVEXT
+ added HB_USER_DLL_ADDONS which can be used to activate rebuilding
Harbour shared library in postinst phase with additional libraries
specified by user in above envvar - it's not officially supported
functionality but temporary workaround until we will not add some
more generic support for above feature so I do not document it in
INSTALL
* harbour/contrib/hbwin/olecore.c
+ added support for conversion safe arrays with any type variants
to Harbour - please test
2009-11-30 14:01 UTC+0100 Viktor Szakats (harbour.01 syenar.hu)
* mpkg_rpm.sh
* INSTALL

View File

@@ -112,7 +112,7 @@ mk_hbgetlibs()
then
libs="$libs gtwin"
fi
echo "hbextern hbvm hbpp hbrtl hbrdd rddfpt rddcdx rddnsx rddntx hbhsx hbsix hbusrrdd ${HB_DB_DRVEXT} hbmacro hbcommon hblang hbcpage gtcrs gtsln gtxvt gtxwc gtcgi gtstd gtpca gttrm $libs gtwvt gtgui gtdos gtos2 hbdebug profiler hbcplr hbpcre hbzlib"
echo "hbextern hbvm hbpp hbrtl hbrdd rddfpt rddcdx rddnsx rddntx hbhsx hbsix hbusrrdd hbmacro hbcommon hblang hbcpage gtcrs gtsln gtxvt gtxwc gtcgi gtstd gtpca gttrm $libs gtwvt gtgui gtdos gtos2 hbdebug profiler hbcplr hbpcre hbzlib"
else
echo "$@"
fi
@@ -129,7 +129,7 @@ mk_hbgetlibsctb()
then
libs="$libs gtwin"
fi
echo "$libs ${HB_DB_DRVEXT} hbct hbnf hbmzip hbnetio hbtip xhb hbgd hbfimage rddsql sddfb sddmy sddpg hbodbc hbpgsql hbmysql hbfbird rddads rddado hbhpdf hbvpdf hbcurl hbwin gtwvg gtalleg hbsqlit3 hbbtree $HB_USER_LIBS"
echo "$libs hbct hbnf hbmzip hbnetio hbtip xhb hbgd hbfimage rddsql sddfb sddmy sddpg hbodbc hbpgsql hbmysql hbfbird rddads rddado hbhpdf hbvpdf hbcurl hbwin gtwvg gtalleg hbsqlit3 hbbtree $HB_USER_LIBS"
#"hbgf hbgt hbbmcdx hbmisc hbsms hbtpathy hbwhat hbziparc hbmsql"
else
echo "$@"
@@ -780,6 +780,9 @@ mk_hblibso()
hb_ver=`get_hbver_so "${hb_rootdir}"`
hb_libs=`mk_hbgetlibs "$2"`
if [ -n "${HB_USER_DLL_ADDONS}" ]; then
hb_libs="${hb_libs} ${HB_USER_DLL_ADDONS}"
fi
[ -z "${HB_GT_LIB}" ] && HB_GT_LIB="gtstd"
(cd ${HB_INST_PKGPREF}${HB_LIB_INSTALL}
@@ -890,12 +893,14 @@ mk_hblibso()
full_lib_name="${lib_pref}${name}${lib_suff}"
full_lib_name_mt="${lib_pref}${name}mt${lib_suff}"
hb_mkdyn="${HB_INST_PKGPREF}${HB_BIN_INSTALL}/${HB_TOOLS_PREF-hb}-mkdyn"
# echo "Making ${full_lib_name}..."
# ${hb_mkdyn} ${full_lib_name} ${LIBS} ${linker_options}
# if [ "${LIBS}" != "${LIBSMT}" ]; then
# echo "Making ${full_lib_name_mt}..."
# ${hb_mkdyn} ${full_lib_name_mt} ${LIBSMT} ${linker_mtoptions} ${linker_options}
# fi
if [ -n "${HB_USER_DLL_ADDONS}" ]; then
echo "Making ${full_lib_name}..."
${hb_mkdyn} ${full_lib_name} ${LIBS} ${linker_options}
if [ "${LIBS}" != "${LIBSMT}" ]; then
echo "Making ${full_lib_name_mt}..."
${hb_mkdyn} ${full_lib_name_mt} ${LIBSMT} ${linker_mtoptions} ${linker_options}
fi
fi
for l in ${full_lib_name} ${full_lib_name_mt}
do
if [ -f $l ]

View File

@@ -526,9 +526,9 @@ void hb_oleItemToVariant( VARIANT* pVariant, PHB_ITEM pItem )
}
static void hb_oleSafeArrayToItem( PHB_ITEM pItem, SAFEARRAY * pSafeArray, int iDim, long * plIndex )
static void hb_oleSafeArrayToItem( PHB_ITEM pItem, SAFEARRAY * pSafeArray,
int iDim, long * plIndex, VARTYPE vt )
{
VARIANT vItem;
long lFrom, lTo;
ULONG ul = 0;
@@ -540,12 +540,23 @@ static void hb_oleSafeArrayToItem( PHB_ITEM pItem, SAFEARRAY * pSafeArray, int i
hb_arrayNew( pItem, lTo - lFrom + 1 );
if( --iDim == 0 )
{
VARIANT vItem;
VariantInit( &vItem );
do
{
plIndex[ iDim ] = lFrom;
if( SafeArrayGetElement( pSafeArray, plIndex, &vItem ) == S_OK )
/* hack: for non VT_VARIANT arrays create VARIANT dynamically
* using pointer to union in variant structure which
* holds all variant values except VT_DECIMAL which is
* stored in different place.
*/
if( SafeArrayGetElement( pSafeArray, plIndex,
vt == VT_VARIANT ? ( void * ) &vItem :
( vt == VT_DECIMAL ? ( void * ) &vItem.n1.decVal :
( void * ) &vItem.n1.n2.n3 ) ) == S_OK )
{
if( vt != VT_VARIANT )
vItem.n1.n2.vt = vt; /* it's reserved in VT_DECIMAL structure */
hb_oleVariantToItem( hb_arrayGetItemPtr( pItem, ++ul ), &vItem );
VariantClear( &vItem );
}
@@ -557,7 +568,8 @@ static void hb_oleSafeArrayToItem( PHB_ITEM pItem, SAFEARRAY * pSafeArray, int i
do
{
plIndex[ iDim ] = lFrom;
hb_oleSafeArrayToItem( hb_arrayGetItemPtr( pItem, ++ul ), pSafeArray, iDim, plIndex );
hb_oleSafeArrayToItem( hb_arrayGetItemPtr( pItem, ++ul ),
pSafeArray, iDim, plIndex, vt );
}
while( ++lFrom <= lTo );
}
@@ -629,14 +641,11 @@ void hb_oleVariantToItem( PHB_ITEM pItem, VARIANT* pVariant )
case VT_DISPATCH:
case VT_DISPATCH | VT_BYREF:
{
IDispatch* pdispVal = pVariant->n1.n2.vt == VT_DISPATCH ?
pVariant->n1.n2.n3.pdispVal :
*pVariant->n1.n2.n3.ppdispVal;
hb_itemClear( pItem );
hb_oleDispatchToItem( pItem, pdispVal );
hb_oleDispatchToItem( pItem, pVariant->n1.n2.vt == VT_DISPATCH ?
pVariant->n1.n2.n3.pdispVal :
*pVariant->n1.n2.n3.ppdispVal );
break;
}
case VT_BSTR:
hb_oleStringToItem( pVariant->n1.n2.n3.bstrVal, pItem );
@@ -835,31 +844,37 @@ void hb_oleVariantToItem( PHB_ITEM pItem, VARIANT* pVariant )
break;
#endif
case VT_VARIANT | VT_ARRAY:
case VT_VARIANT | VT_ARRAY | VT_BYREF:
{
SAFEARRAY * pSafeArray = pVariant->n1.n2.vt & VT_BYREF ?
*pVariant->n1.n2.n3.pparray :
pVariant->n1.n2.n3.parray;
if( pSafeArray )
{
int iDim;
if( ( iDim = ( int ) SafeArrayGetDim( pSafeArray ) ) >= 1 )
{
long * plIndex = ( long * ) hb_xgrab( iDim * sizeof( long ) );
hb_oleSafeArrayToItem( pItem, pSafeArray, iDim, plIndex );
hb_xfree( plIndex );
}
else
hb_arrayNew( pItem, 0 );
break;
}
/* Fall through */
}
case VT_EMPTY:
case VT_EMPTY | VT_BYREF:
case VT_NULL:
case VT_NULL | VT_BYREF:
hb_itemClear( pItem );
break;
default:
if( pVariant->n1.n2.vt & VT_ARRAY )
{
SAFEARRAY * pSafeArray = pVariant->n1.n2.vt & VT_BYREF ?
*pVariant->n1.n2.n3.pparray :
pVariant->n1.n2.n3.parray;
if( pSafeArray )
{
int iDim;
if( ( iDim = ( int ) SafeArrayGetDim( pSafeArray ) ) >= 1 )
{
long * plIndex = ( long * ) hb_xgrab( iDim * sizeof( long ) );
hb_oleSafeArrayToItem( pItem, pSafeArray, iDim, plIndex,
( pVariant->n1.n2.vt & ~( VT_ARRAY | VT_BYREF ) ) );
hb_xfree( plIndex );
}
else
hb_arrayNew( pItem, 0 );
break;
}
}
/* possible RT error - unsupported variant */
hb_itemClear( pItem );
}
}