2009-02-25 03:37 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
+ harbour/config/linux/icc.cf
* harbour/config/linux/gcc.cf
* harbour/bin/hb-func.sh
* harbour/bin/postinst.sh
* harbour/source/common/hbver.c
+ added support for Intel(R) C/C++ compiler
* harbour/bin/postinst.sh
% use hb-mkdyn symlink instead of regenerating it as hb-mkslib
It will work also in DOS/Windows (MSys/DJGPP emulates ln -s ...)
* harbour/source/vm/thread.c
* removed all references to HB_THREAD_EQUAL()/HB_THREAD_SELF() in
non MT builds
* harbour/source/rtl/console.c
! fixed default color setting in hb_dispOutAtBox()
* harbour/contrib/gtwvg/wvggui.h
* harbour/contrib/gtwvg/wvgwin.c
* harbour/contrib/gtwvg/wincallb.c
* harbour/contrib/gtwvg/wvgsink.c
! fixes for C++ compilation:
- this is reserved word in C++ - do not use it as variable name
- class is reserved word in C++ - do not use it as variable name
- use macros to hide differences between C and C++ WinAPI
- casting
This commit is contained in:
@@ -8,6 +8,35 @@
|
||||
2009-12-31 13:59 UTC+0100 Foo Bar (foo.bar foobar.org)
|
||||
*/
|
||||
|
||||
2009-02-25 03:37 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
|
||||
+ harbour/config/linux/icc.cf
|
||||
* harbour/config/linux/gcc.cf
|
||||
* harbour/bin/hb-func.sh
|
||||
* harbour/bin/postinst.sh
|
||||
* harbour/source/common/hbver.c
|
||||
+ added support for Intel(R) C/C++ compiler
|
||||
|
||||
* harbour/bin/postinst.sh
|
||||
% use hb-mkdyn symlink instead of regenerating it as hb-mkslib
|
||||
It will work also in DOS/Windows (MSys/DJGPP emulates ln -s ...)
|
||||
|
||||
* harbour/source/vm/thread.c
|
||||
* removed all references to HB_THREAD_EQUAL()/HB_THREAD_SELF() in
|
||||
non MT builds
|
||||
|
||||
* harbour/source/rtl/console.c
|
||||
! fixed default color setting in hb_dispOutAtBox()
|
||||
|
||||
* harbour/contrib/gtwvg/wvggui.h
|
||||
* harbour/contrib/gtwvg/wvgwin.c
|
||||
* harbour/contrib/gtwvg/wincallb.c
|
||||
* harbour/contrib/gtwvg/wvgsink.c
|
||||
! fixes for C++ compilation:
|
||||
- this is reserved word in C++ - do not use it as variable name
|
||||
- class is reserved word in C++ - do not use it as variable name
|
||||
- use macros to hide differences between C and C++ WinAPI
|
||||
- casting
|
||||
|
||||
2009-02-24 23:14 UTC+0100 Viktor Szakats (harbour.01 syenar hu)
|
||||
* utils/hbmk2/hbmk2.prg
|
||||
! Fixed warning.
|
||||
|
||||
@@ -275,6 +275,8 @@ export PATH="\${HB_BIN_INSTALL}${hb_path_separator}${CCPATH}\${PATH}"
|
||||
|
||||
if [ "\${HB_COMPILER}" == "gpp" ]; then
|
||||
HB_CC="g++"
|
||||
elif [ "\${HB_COMPILER}" == "icc" ]; then
|
||||
HB_CC="icc"
|
||||
else
|
||||
HB_CC="gcc"
|
||||
fi
|
||||
|
||||
@@ -42,7 +42,7 @@ fi
|
||||
|
||||
if [ "$HB_COMPILER" = "gcc" ] || [ "$HB_COMPILER" = "gpp" ] || \
|
||||
[ "$HB_COMPILER" = "mingw" ] || [ "$HB_COMPILER" = "mingwce" ] || \
|
||||
[ "$HB_COMPILER" = "djgpp" ]
|
||||
[ "$HB_COMPILER" = "djgpp" ] || [ "$HB_COMPILER" = "icc" ]
|
||||
then
|
||||
RANLIB=""
|
||||
MAKE=make
|
||||
@@ -66,39 +66,35 @@ then
|
||||
-e "s/^# CCPREFIX=\"\"\$/[ -n \"\${CCPREFIX}\" ] || CCPREFIX=\"${CCPREFIX}\"/g" \
|
||||
"${hb_root}/bin/hb-mkdyn.sh" > "${hb_mkdyn}" && \
|
||||
chmod 755 "${hb_mkdyn}"
|
||||
elif [ "${HB_ARCHITECTURE}" = "sunos" ] || \
|
||||
[ "${HB_ARCHITECTURE}" = "hpux" ] || \
|
||||
! which install &>/dev/null; then
|
||||
rm -f "${HB_BIN_INSTALL}/hb-mkdyn"
|
||||
cp "${hb_root}/bin/hb-mkdyn.sh" "${HB_BIN_INSTALL}/hb-mkdyn" && \
|
||||
chmod 755 "${HB_BIN_INSTALL}/hb-mkdyn"
|
||||
elif [ "${HB_ARCHITECTURE}" != "dos" ]; then
|
||||
# Without -c some OSes _move_ the file instead of copying it!
|
||||
install -c -m 755 "${hb_root}/bin/hb-mkdyn.sh" "${HB_BIN_INSTALL}/hb-mkdyn"
|
||||
fi
|
||||
|
||||
# Compatibility hb-mkslib creation. Please use hb-mkdyn instead.
|
||||
if [ -n "${HB_TOOLS_PREF}" ]; then
|
||||
hb_mkdyn="${HB_BIN_INSTALL}/${HB_TOOLS_PREF}-mkslib"
|
||||
elif [ "$HB_COMPILER" = "icc" ]; then
|
||||
hb_mkdyn="${HB_BIN_INSTALL}/hb-mkdyn"
|
||||
rm -f "${hb_mkdyn}"
|
||||
sed -e "s/^# HB_ARCHITECTURE=\"\"\$/HB_ARCHITECTURE=\"${HB_ARCHITECTURE}\"/g" \
|
||||
-e "s/^# CCPREFIX=\"\"\$/[ -n \"\${CCPREFIX}\" ] || CCPREFIX=\"${CCPREFIX}\"/g" \
|
||||
"${hb_root}/bin/hb-mkdyn.sh" > "${hb_mkdyn}" && \
|
||||
sed -e "s/gcc/icc/g" "${hb_root}/bin/hb-mkdyn.sh" > "${hb_mkdyn}" && \
|
||||
chmod 755 "${hb_mkdyn}"
|
||||
elif [ "${HB_ARCHITECTURE}" = "sunos" ] || \
|
||||
[ "${HB_ARCHITECTURE}" = "hpux" ] || \
|
||||
! which install &>/dev/null; then
|
||||
rm -f "${HB_BIN_INSTALL}/hb-mkslib"
|
||||
cp "${hb_root}/bin/hb-mkdyn.sh" "${HB_BIN_INSTALL}/hb-mkslib" && \
|
||||
chmod 755 "${HB_BIN_INSTALL}/hb-mkslib"
|
||||
hb_mkdyn="${HB_BIN_INSTALL}/hb-mkdyn"
|
||||
rm -f "${hb_mkdyn}"
|
||||
cp "${hb_root}/bin/hb-mkdyn.sh" "${hb_mkdyn}" && \
|
||||
chmod 755 "${hb_mkdyn}"
|
||||
elif [ "${HB_ARCHITECTURE}" != "dos" ]; then
|
||||
hb_mkdyn="${HB_BIN_INSTALL}/hb-mkdyn"
|
||||
# Without -c some OSes _move_ the file instead of copying it!
|
||||
install -c -m 755 "${hb_root}/bin/hb-mkdyn.sh" "${HB_BIN_INSTALL}/hb-mkslib"
|
||||
install -c -m 755 "${hb_root}/bin/hb-mkdyn.sh" "${hb_mkdyn}"
|
||||
fi
|
||||
|
||||
# Compatibility hb-mkslib creation. Please use hb-mkdyn instead.
|
||||
if [ -n "${hb_mkdyn}" ] && [ -f "${hb_mkdyn}" ]; then
|
||||
hb_mkdyn="${hb_mkdyn//-mkdyn/-mkslib}"
|
||||
rm -f "${hb_mkdyn}"
|
||||
ln -s hb-mkdyn "${hb_mkdyn}"
|
||||
fi
|
||||
|
||||
mk_hbtools "${HB_BIN_INSTALL}" "$@"
|
||||
if [ "$HB_COMPILER" = "gcc" ] || [ "$HB_COMPILER" = "gpp" ] || \
|
||||
[ "$HB_COMPILER" = "mingw" ] || [ "$HB_COMPILER" = "mingwce" ]; then
|
||||
[ "$HB_COMPILER" = "mingw" ] || [ "$HB_COMPILER" = "mingwce" ] || \
|
||||
[ "$HB_COMPILER" = "icc" ]; then
|
||||
mk_hblibso "${hb_root}"
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -20,7 +20,14 @@ CC_IN = -c
|
||||
CC_OUT = -o
|
||||
CPPFLAGS = -I. -I$(HB_INC_COMPILE)
|
||||
|
||||
ifeq ($(HB_COMPILER),icc)
|
||||
CFLAGS = -O3 -D_GNU_SOURCE
|
||||
#CFLAGS += -std=c99
|
||||
#CFLAGS += -xHOST
|
||||
#CFLAGS += -w2 -Wall
|
||||
else
|
||||
CFLAGS = -Wall -W -O3
|
||||
endif
|
||||
|
||||
# uncomment this if you want to force relocateable code for .so libs
|
||||
# it's necessary on some platforms but can reduce performance
|
||||
@@ -90,6 +97,6 @@ LDFLAGS = $(LINKPATHS)
|
||||
|
||||
AR = ar
|
||||
ARFLAGS = $(HB_USER_AFLAGS)
|
||||
AR_RULE = $(AR) $(ARFLAGS) cr $(LIB_DIR)/$@ $(^F) && $(RANLIB) $(LIB_DIR)/$@ || ( $(RM) $(LIB_DIR)/$@ && false )
|
||||
AR_RULE = $(AR) $(ARFLAGS) crs $(LIB_DIR)/$@ $(^F) || ( $(RM) $(LIB_DIR)/$@ && false )
|
||||
|
||||
include $(TOP)$(ROOT)config/rules.cf
|
||||
|
||||
97
harbour/config/linux/icc.cf
Normal file
97
harbour/config/linux/icc.cf
Normal file
@@ -0,0 +1,97 @@
|
||||
#
|
||||
# $Id$
|
||||
#
|
||||
|
||||
include $(TOP)$(ROOT)config/$(HB_ARCHITECTURE)/global.cf
|
||||
|
||||
# set compiler name to icc or icpc
|
||||
HB_CMP = $(HB_COMPILER)
|
||||
|
||||
OBJ_EXT = .o
|
||||
EXE_EXT =
|
||||
LIB_PREF = lib
|
||||
LIB_EXT = .a
|
||||
|
||||
CC = $(HB_CCACHE) $(HB_CMP)
|
||||
CC_IN = -c
|
||||
CC_OUT = -o
|
||||
CPPFLAGS = -I. -I$(HB_INC_COMPILE)
|
||||
|
||||
#CFLAGS = -fast
|
||||
#CFLAGS = -xHOST
|
||||
CFLAGS = -O3 -D_GNU_SOURCE
|
||||
#CFLAGS += -std=c99
|
||||
#CFLAGS += -w2 -Wall
|
||||
|
||||
|
||||
# uncomment this if you want to force relocateable code for .so libs
|
||||
# it's necessary on some platforms but can reduce performance
|
||||
#CFLAGS += -fPIC
|
||||
|
||||
LD = $(HB_CCACHE) $(HB_CMP)
|
||||
LD_OUT = -o
|
||||
|
||||
# Add all libraries specified in CONTRIBS and LIBS.
|
||||
ifeq ($(HB_LIB_COMPILE),)
|
||||
LINKPATHS += -L$(LIB_DIR)
|
||||
else
|
||||
LINKPATHS += -L$(HB_LIB_COMPILE)
|
||||
endif
|
||||
|
||||
# our libs have a lot of cross referenced now and we have to group them
|
||||
# untill we don't clean them
|
||||
LINKLIBS += -Wl,--start-group
|
||||
|
||||
LINKLIBS += $(foreach lib, $(CONTRIBS), -l$(subst lib,,$(lib)))
|
||||
LINKLIBS += $(foreach lib, $(LIBS), -l$(lib))
|
||||
|
||||
# If LIBS specifies the rdd library, add all DB drivers.
|
||||
ifeq ($(findstring rdd,$(LIBS)),rdd)
|
||||
LINKLIBS += $(foreach drv, $(HB_DB_DRIVERS), -l$(drv))
|
||||
endif
|
||||
|
||||
# Add the specified GT driver library and other RTLs
|
||||
ifeq ($(findstring rtl,$(LIBS)),rtl)
|
||||
|
||||
LINKLIBS += $(foreach gt, $(HB_GT_LIBS), -l$(gt))
|
||||
|
||||
# screen driver libraries
|
||||
ifeq ($(HB_CRS_LIB),)
|
||||
HB_CRS_LIB=ncurses
|
||||
endif
|
||||
ifneq ($(findstring gtcrs, $(HB_GT_LIBS)),)
|
||||
LINKLIBS += -l$(HB_CRS_LIB)
|
||||
endif
|
||||
ifneq ($(findstring gtsln, $(HB_GT_LIBS)),)
|
||||
LINKLIBS += -lslang
|
||||
endif
|
||||
ifneq ($(findstring gtxwc, $(HB_GT_LIBS)),)
|
||||
LINKLIBS += -lX11
|
||||
#LINKPATHS += -L/usr/X11R6/lib64
|
||||
LINKPATHS += -L/usr/X11R6/lib
|
||||
endif
|
||||
|
||||
# HB_GPM_MOUSE: use gpm mouse driver
|
||||
ifeq ($(HB_GPM_MOUSE),yes)
|
||||
LINKLIBS += -lgpm
|
||||
endif
|
||||
|
||||
endif
|
||||
|
||||
ifneq ($(findstring -DHB_PCRE_REGEX, $(HB_USER_CFLAGS)),)
|
||||
LINKLIBS += -lpcre
|
||||
endif
|
||||
|
||||
ifneq ($(findstring -DHB_EXT_ZLIB, $(HB_USER_CFLAGS)),)
|
||||
LINKLIBS += -lz
|
||||
endif
|
||||
|
||||
LINKLIBS += -lm -lrt -ldl -Wl,--end-group
|
||||
|
||||
LDFLAGS = $(LINKPATHS)
|
||||
|
||||
AR = xiar
|
||||
ARFLAGS = $(HB_USER_AFLAGS)
|
||||
AR_RULE = $(AR) $(ARFLAGS) crs $(LIB_DIR)/$@ $(^F) || ( $(RM) $(LIB_DIR)/$@ && false )
|
||||
|
||||
include $(TOP)$(ROOT)config/rules.cf
|
||||
@@ -327,7 +327,7 @@ static LPVOID _GenerateCallback( CALLBACKDATA * pCallback )
|
||||
int iParVal1;
|
||||
int iParVal2;
|
||||
|
||||
pMem = FuncMemAlloc();
|
||||
pMem = ( byte * ) FuncMemAlloc();
|
||||
|
||||
if( pMem )
|
||||
{
|
||||
@@ -400,7 +400,7 @@ static LPVOID _GenerateCallback( CALLBACKDATA * pCallback )
|
||||
|
||||
HB_FUNC( _FREECALLBACK )
|
||||
{
|
||||
void* ptr = ( void* ) ( HB_PTRDIFF ) hb_parnint( 1 );
|
||||
LPBYTE ptr = ( LPBYTE ) ( HB_PTRDIFF ) hb_parnint( 1 );
|
||||
|
||||
hb_retl( FuncMemFree( ptr ) );
|
||||
return;
|
||||
@@ -511,7 +511,7 @@ static LPVOID FuncMemAlloc( void )
|
||||
//find empty slot
|
||||
for( i = 0 ; i < dwReservedLen ; i++ ) // each reservation
|
||||
{
|
||||
lpPage = ( pAllAllocs+i )->lpvBase;
|
||||
lpPage = ( char * ) ( pAllAllocs+i )->lpvBase;
|
||||
|
||||
for( j = 0 ; j < dwPagesInAlloc ; j++ ) // each reserved page
|
||||
{
|
||||
@@ -543,7 +543,7 @@ static LPVOID FuncMemAlloc( void )
|
||||
break;
|
||||
}
|
||||
|
||||
( ( pAllAllocs+i )->MemPages+j )->lpPage = lpvBase;
|
||||
( ( pAllAllocs+i )->MemPages+j )->lpPage = ( LPTSTR ) lpvBase;
|
||||
( ( pAllAllocs+i )->MemPages+j )->bCommited = TRUE;
|
||||
( ( pAllAllocs+i )->MemPages+j )->Functions = ( FuncData* ) malloc( dwFuncsInPage * sizeof( FuncData ) );
|
||||
|
||||
|
||||
@@ -66,8 +66,6 @@
|
||||
#define CINTERFACE 1
|
||||
#endif
|
||||
|
||||
#define NONAMELESSUNION
|
||||
|
||||
//-------------------------------------------------------------------//
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
@@ -80,7 +80,9 @@
|
||||
*/
|
||||
//----------------------------------------------------------------------//
|
||||
|
||||
#define NONAMELESSUNION
|
||||
#ifndef CINTERFACE
|
||||
#define CINTERFACE 1
|
||||
#endif
|
||||
|
||||
#ifdef __XHARBOUR__
|
||||
#include "hbvmopt.h"
|
||||
@@ -107,6 +109,14 @@
|
||||
|
||||
//#include <strsafe.h>
|
||||
|
||||
#if defined( __cplusplus ) && \
|
||||
( defined( __BORLANDC__ ) || defined( _MSC_VER ) || \
|
||||
( defined(__WATCOMC__) && ( __WATCOMC__ >= 1280 ) ) )
|
||||
# define HB_ID_REF( id ) id
|
||||
#else
|
||||
# define HB_ID_REF( id ) ( &(id) )
|
||||
#endif
|
||||
|
||||
//----------------------------------------------------------------------//
|
||||
|
||||
#if defined(__BORLANDC__) && !defined(HB_ARCH_64BIT)
|
||||
@@ -231,10 +241,10 @@ DECLARE_INTERFACE_ ( INTERFACE, IDispatch )
|
||||
STDMETHOD_ ( ULONG, AddRef ) ( THIS ) PURE;
|
||||
STDMETHOD_ ( ULONG, Release ) ( THIS ) PURE;
|
||||
// IDispatch functions
|
||||
STDMETHOD_ ( ULONG, GetTypeInfoCount ) ( THIS_ UINT * ) PURE;
|
||||
STDMETHOD_ ( ULONG, GetTypeInfo ) ( THIS_ UINT, LCID, ITypeInfo ** ) PURE;
|
||||
STDMETHOD_ ( ULONG, GetIDsOfNames ) ( THIS_ REFIID, LPOLESTR *, UINT, LCID, DISPID * ) PURE;
|
||||
STDMETHOD_ ( ULONG, Invoke ) ( THIS_ DISPID, REFIID, LCID, WORD, DISPPARAMS *, VARIANT *, EXCEPINFO *, UINT * ) PURE;
|
||||
STDMETHOD ( GetTypeInfoCount ) ( THIS_ UINT * ) PURE;
|
||||
STDMETHOD ( GetTypeInfo ) ( THIS_ UINT, LCID, ITypeInfo ** ) PURE;
|
||||
STDMETHOD ( GetIDsOfNames ) ( THIS_ REFIID, LPOLESTR *, UINT, LCID, DISPID * ) PURE;
|
||||
STDMETHOD ( Invoke ) ( THIS_ DISPID, REFIID, LCID, WORD, DISPPARAMS *, VARIANT *, EXCEPINFO *, UINT * ) PURE;
|
||||
};
|
||||
//----------------------------------------------------------------------//
|
||||
//
|
||||
@@ -284,7 +294,7 @@ typedef struct {
|
||||
// AddRef(), and Release().
|
||||
|
||||
// IEventHandler's QueryInterface()
|
||||
static HRESULT STDMETHODCALLTYPE QueryInterface( IEventHandler *this, REFIID vTableGuid, void **ppv )
|
||||
static HRESULT STDMETHODCALLTYPE QueryInterface( IEventHandler *self, REFIID vTableGuid, void **ppv )
|
||||
{
|
||||
// Check if the GUID matches IEvenetHandler VTable's GUID. We gave the C variable name
|
||||
// IID_IEventHandler to our VTable GUID. We can use an OLE function called
|
||||
@@ -294,30 +304,30 @@ static HRESULT STDMETHODCALLTYPE QueryInterface( IEventHandler *this, REFIID vTa
|
||||
// IDispatch GUID, then we'll return the IExample3, since it can masquerade
|
||||
// as an IDispatch too
|
||||
|
||||
if ( IsEqualIID( vTableGuid, &IID_IUnknown ) )
|
||||
if ( IsEqualIID( vTableGuid, HB_ID_REF( IID_IUnknown ) ) )
|
||||
{
|
||||
*ppv = ( IUnknown * ) this;
|
||||
/* Increment the count of callers who have an outstanding pointer to this object */
|
||||
//hb_ToOutDebug( ".................................if ( IsEqualIID( vTableGuid, &IID_IUnknown ) )" );
|
||||
this->lpVtbl->AddRef( this );
|
||||
*ppv = ( IUnknown * ) self;
|
||||
/* Increment the count of callers who have an outstanding pointer to self object */
|
||||
//hb_ToOutDebug( ".................................if ( IsEqualIID( vTableGuid, HB_ID_REF( IID_IUnknown ) ) )" );
|
||||
self->lpVtbl->AddRef( self );
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
if ( IsEqualIID( vTableGuid, &IID_IDispatch ) )
|
||||
if ( IsEqualIID( vTableGuid, HB_ID_REF( IID_IDispatch ) ) )
|
||||
{
|
||||
*ppv = ( IDispatch * ) this;
|
||||
//hb_ToOutDebug( ".................................if ( IsEqualIID( vTableGuid, &IID_IDispatch ) )" );
|
||||
this->lpVtbl->AddRef( this );
|
||||
*ppv = ( IDispatch * ) self;
|
||||
//hb_ToOutDebug( ".................................if ( IsEqualIID( vTableGuid, HB_ID_REF( IID_IDispatch ) ) )" );
|
||||
self->lpVtbl->AddRef( self );
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
if ( IsEqualIID( vTableGuid, &( ( ( MyRealIEventHandler * ) this )->device_event_interface_iid ) ) )
|
||||
if ( IsEqualIID( vTableGuid, HB_ID_REF( ( ( MyRealIEventHandler * ) self )->device_event_interface_iid ) ) )
|
||||
{
|
||||
if( ++( ( MyRealIEventHandler * ) this )->iID_riid == 1 )
|
||||
if( ++( ( MyRealIEventHandler * ) self )->iID_riid == 1 )
|
||||
{
|
||||
*ppv = ( IDispatch* ) this;
|
||||
//hb_ToOutDebug( ".................................if ( IsEqualIID( vTableGuid, &( ( ( MyRealIEventHandler * ) this )->device_event_interface_iid ) ) )" );
|
||||
this->lpVtbl->AddRef( this );
|
||||
*ppv = ( IDispatch* ) self;
|
||||
//hb_ToOutDebug( ".................................if ( IsEqualIID( vTableGuid, HB_ID_REF( ( ( MyRealIEventHandler * ) self )->device_event_interface_iid ) ) )" );
|
||||
self->lpVtbl->AddRef( self );
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
@@ -331,7 +341,7 @@ static HRESULT STDMETHODCALLTYPE QueryInterface( IEventHandler *this, REFIID vTa
|
||||
//
|
||||
// IEventHandler's AddRef()
|
||||
|
||||
static ULONG STDMETHODCALLTYPE AddRef( IEventHandler *this )
|
||||
static ULONG STDMETHODCALLTYPE AddRef( IEventHandler *self )
|
||||
{
|
||||
// Increment IEventHandler's reference count, and return the updated value.
|
||||
// NOTE: We have to typecast to gain access to any data members. These
|
||||
@@ -339,81 +349,81 @@ static ULONG STDMETHODCALLTYPE AddRef( IEventHandler *this )
|
||||
// Rather they are defined only above in our MyRealIEventHandler
|
||||
// struct. So typecast to that in order to access those data members
|
||||
|
||||
//hb_ToOutDebug( "AddRef->count=%i", ( ( MyRealIEventHandler * ) this )->count + 1 );
|
||||
return( ++( ( MyRealIEventHandler * ) this )->count );
|
||||
//hb_ToOutDebug( "AddRef->count=%i", ( ( MyRealIEventHandler * ) self )->count + 1 );
|
||||
return( ++( ( MyRealIEventHandler * ) self )->count );
|
||||
}
|
||||
//----------------------------------------------------------------------//
|
||||
//
|
||||
// IEventHandler's Release()
|
||||
|
||||
static ULONG STDMETHODCALLTYPE Release( IEventHandler *this )
|
||||
static ULONG STDMETHODCALLTYPE Release( IEventHandler *self )
|
||||
{
|
||||
#if 0
|
||||
hb_ToOutDebug( "static ULONG STDMETHODCALLTYPE Release( IEventHandler *this )->count = %i",
|
||||
( ( MyRealIEventHandler * ) this )->count - 1 );
|
||||
hb_ToOutDebug( "static ULONG STDMETHODCALLTYPE Release( IEventHandler *self )->count = %i",
|
||||
( ( MyRealIEventHandler * ) self )->count - 1 );
|
||||
#endif
|
||||
if ( --( ( MyRealIEventHandler * ) this )->count == 0 )
|
||||
if ( --( ( MyRealIEventHandler * ) self )->count == 0 )
|
||||
{
|
||||
if( ( ( MyRealIEventHandler * ) this)->pSelf )
|
||||
if( ( ( MyRealIEventHandler * ) self)->pSelf )
|
||||
{
|
||||
hb_itemRelease( ( ( MyRealIEventHandler * ) this )->pSelf );
|
||||
hb_itemRelease( ( ( MyRealIEventHandler * ) self )->pSelf );
|
||||
}
|
||||
|
||||
if( ( MyRealIEventHandler * ) this )
|
||||
if( ( MyRealIEventHandler * ) self )
|
||||
{
|
||||
GlobalFree( ( MyRealIEventHandler * ) this );
|
||||
GlobalFree( ( MyRealIEventHandler * ) self );
|
||||
}
|
||||
//hb_ToOutDebug( " ULONG STDMETHODCALLTYPE Release( IEventHandler *this )->this" );
|
||||
//hb_ToOutDebug( " ULONG STDMETHODCALLTYPE Release( IEventHandler *self )->self" );
|
||||
return( ( ULONG ) 0 );
|
||||
}
|
||||
return( ( ULONG ) ( ( MyRealIEventHandler * ) this )->count < 0 ? ( ( MyRealIEventHandler * ) this )->count : 0 );
|
||||
return( ( ULONG ) ( ( MyRealIEventHandler * ) self )->count < 0 ? ( ( MyRealIEventHandler * ) self )->count : 0 );
|
||||
}
|
||||
//----------------------------------------------------------------------//
|
||||
//
|
||||
// IEventHandler's GetTypeInfoCount()
|
||||
|
||||
static ULONG STDMETHODCALLTYPE GetTypeInfoCount( IEventHandler *this, UINT *pCount )
|
||||
static HRESULT STDMETHODCALLTYPE GetTypeInfoCount( IEventHandler *self, UINT *pCount )
|
||||
{
|
||||
HB_SYMBOL_UNUSED( this );
|
||||
HB_SYMBOL_UNUSED( self );
|
||||
HB_SYMBOL_UNUSED( pCount );
|
||||
|
||||
return ( ULONG ) E_NOTIMPL;
|
||||
return ( HRESULT ) E_NOTIMPL;
|
||||
}
|
||||
//----------------------------------------------------------------------//
|
||||
//
|
||||
// IEventHandler's GetTypeInfo()
|
||||
|
||||
static ULONG STDMETHODCALLTYPE GetTypeInfo( IEventHandler *this, UINT itinfo, LCID lcid, ITypeInfo **pTypeInfo )
|
||||
static HRESULT STDMETHODCALLTYPE GetTypeInfo( IEventHandler *self, UINT itinfo, LCID lcid, ITypeInfo **pTypeInfo )
|
||||
{
|
||||
HB_SYMBOL_UNUSED( this );
|
||||
HB_SYMBOL_UNUSED( self );
|
||||
HB_SYMBOL_UNUSED( itinfo );
|
||||
HB_SYMBOL_UNUSED( lcid );
|
||||
HB_SYMBOL_UNUSED( pTypeInfo );
|
||||
|
||||
return ( ULONG ) E_NOTIMPL;
|
||||
return ( HRESULT ) E_NOTIMPL;
|
||||
}
|
||||
//----------------------------------------------------------------------//
|
||||
//
|
||||
// IEventHandler's GetIDsOfNames()
|
||||
|
||||
static ULONG STDMETHODCALLTYPE GetIDsOfNames( IEventHandler *this, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgdispid )
|
||||
static HRESULT STDMETHODCALLTYPE GetIDsOfNames( IEventHandler *self, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgdispid )
|
||||
{
|
||||
|
||||
HB_SYMBOL_UNUSED( this );
|
||||
HB_SYMBOL_UNUSED( self );
|
||||
HB_SYMBOL_UNUSED( riid );
|
||||
HB_SYMBOL_UNUSED( rgszNames );
|
||||
HB_SYMBOL_UNUSED( cNames );
|
||||
HB_SYMBOL_UNUSED( lcid );
|
||||
HB_SYMBOL_UNUSED( rgdispid );
|
||||
|
||||
return ( ULONG ) E_NOTIMPL;
|
||||
return ( HRESULT ) E_NOTIMPL;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
static ULONG STDMETHODCALLTYPE Invoke( IEventHandler *this, DISPID dispid, REFIID riid,
|
||||
LCID lcid, WORD wFlags, DISPPARAMS *params,
|
||||
VARIANT *result, EXCEPINFO *pexcepinfo, UINT *puArgErr )
|
||||
static HRESULT STDMETHODCALLTYPE Invoke( IEventHandler *self, DISPID dispid, REFIID riid,
|
||||
LCID lcid, WORD wFlags, DISPPARAMS *params,
|
||||
VARIANT *result, EXCEPINFO *pexcepinfo, UINT *puArgErr )
|
||||
{
|
||||
int iArg;
|
||||
int i;
|
||||
@@ -425,9 +435,9 @@ static ULONG STDMETHODCALLTYPE Invoke( IEventHandler *this, DISPID dispid, REFII
|
||||
PHB_ITEM Key;
|
||||
//hb_ToOutDebug( "event = %i",(int)dispid );
|
||||
// We implement only a "default" interface
|
||||
if ( !IsEqualIID( riid, &IID_NULL ) )
|
||||
if ( !IsEqualIID( riid, HB_ID_REF( IID_NULL ) ) )
|
||||
{
|
||||
return( ( ULONG ) DISP_E_UNKNOWNINTERFACE );
|
||||
return( ( HRESULT ) DISP_E_UNKNOWNINTERFACE );
|
||||
}
|
||||
HB_SYMBOL_UNUSED( lcid );
|
||||
HB_SYMBOL_UNUSED( wFlags );
|
||||
@@ -436,9 +446,9 @@ static ULONG STDMETHODCALLTYPE Invoke( IEventHandler *this, DISPID dispid, REFII
|
||||
HB_SYMBOL_UNUSED( puArgErr );
|
||||
|
||||
Key = hb_itemNew( NULL );
|
||||
if ( hb_hashScan( ( ( MyRealIEventHandler * ) this )->pEvents, hb_itemPutNL( Key, dispid ), &ulPos ) )
|
||||
if ( hb_hashScan( ( ( MyRealIEventHandler * ) self )->pEvents, hb_itemPutNL( Key, dispid ), &ulPos ) )
|
||||
{
|
||||
PHB_ITEM pArray = hb_hashGetValueAt( ( ( MyRealIEventHandler * ) this )->pEvents, ulPos );
|
||||
PHB_ITEM pArray = hb_hashGetValueAt( ( ( MyRealIEventHandler * ) self )->pEvents, ulPos );
|
||||
PHB_ITEM pExec = hb_arrayGetItemPtr( pArray, 1 );
|
||||
|
||||
if ( pExec )
|
||||
@@ -534,7 +544,7 @@ static ULONG STDMETHODCALLTYPE Invoke( IEventHandler *this, DISPID dispid, REFII
|
||||
}
|
||||
hb_itemRelease( Key ); // Pritpal
|
||||
|
||||
return ( ULONG ) S_OK;
|
||||
return ( HRESULT ) S_OK;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------//
|
||||
@@ -590,10 +600,10 @@ static HRESULT SetupConnectionPoint( device_interface* pdevice_interface, REFIID
|
||||
( ( MyRealIEventHandler * ) thisobj )->count = 0;
|
||||
( ( MyRealIEventHandler * ) thisobj )->iID_riid = 0;
|
||||
|
||||
hr = thisobj->lpVtbl->QueryInterface( thisobj, &IID_IUnknown, (void **) (void*) &pIUnknown );
|
||||
hr = thisobj->lpVtbl->QueryInterface( thisobj, HB_ID_REF( IID_IUnknown ), (void **) (void*) &pIUnknown );
|
||||
if (hr == S_OK && pIUnknown)
|
||||
{
|
||||
hr = pdevice_interface->lpVtbl->QueryInterface( pdevice_interface, &IID_IConnectionPointContainer, (void**) (void*) &pIConnectionPointContainerTemp);
|
||||
hr = pdevice_interface->lpVtbl->QueryInterface( pdevice_interface, HB_ID_REF( IID_IConnectionPointContainer ), (void**) (void*) &pIConnectionPointContainerTemp);
|
||||
if ( hr == S_OK && pIConnectionPointContainerTemp )
|
||||
{
|
||||
hr = pIConnectionPointContainerTemp->lpVtbl->EnumConnectionPoints( pIConnectionPointContainerTemp, &m_pIEnumConnectionPoints );
|
||||
@@ -802,7 +812,7 @@ HB_FUNC( HB_AX_ATLAXCREATECONTROL )
|
||||
UINT uLen;
|
||||
PATLAXCREATECONTROL AtlAxCreateControl;
|
||||
HWND hContainer = NULL;
|
||||
char *class = hb_parc( 1 );
|
||||
char *szClass = hb_parc( 1 );
|
||||
HWND hParent = ( HWND ) ( HB_PTRDIFF ) hb_parnint( 2 );
|
||||
char *Caption = ISNIL( 4 ) ? "" : hb_parc( 3 );
|
||||
HMENU id = ISNIL( 4 ) ? ( HMENU ) ( HB_PTRDIFF ) -1 : ( HMENU ) ( HB_PTRDIFF ) hb_parnint( 4 );
|
||||
@@ -826,7 +836,7 @@ HB_FUNC( HB_AX_ATLAXCREATECONTROL )
|
||||
if ( AtlAxCreateControl )
|
||||
{
|
||||
LPTSTR cCaption = HB_TCHAR_CONVTO( Caption );
|
||||
LPTSTR cClass = HB_TCHAR_CONVTO( class );
|
||||
LPTSTR cClass = HB_TCHAR_CONVTO( szClass );
|
||||
#if 0
|
||||
hContainer = ( HWND ) CreateWindowEx( Exstyle, cClass, cCaption, Style, x, y, w, h,
|
||||
hParent, id, GetModuleHandle( NULL ), NULL );
|
||||
@@ -854,7 +864,7 @@ HB_FUNC( HB_AX_ATLAXCREATECONTROL )
|
||||
#if 1
|
||||
if( pUnk )
|
||||
{
|
||||
pUnk->lpVtbl->QueryInterface( pUnk, &IID_IDispatch, ( void** ) (void*) &obj );
|
||||
pUnk->lpVtbl->QueryInterface( pUnk, HB_ID_REF( IID_IDispatch ), ( void** ) (void*) &obj );
|
||||
pUnk->lpVtbl->Release( pUnk );
|
||||
hb_retnint( ( HB_PTRDIFF ) obj );
|
||||
|
||||
@@ -871,7 +881,7 @@ HB_FUNC( HB_AX_ATLAXCREATECONTROL )
|
||||
{
|
||||
RECT rc;
|
||||
|
||||
pUnkCtrl->lpVtbl->QueryInterface( pUnkCtrl, &IID_IDispatch, ( void** ) (void*) &obj );
|
||||
pUnkCtrl->lpVtbl->QueryInterface( pUnkCtrl, HB_ID_REF( IID_IDispatch ), ( void** ) (void*) &obj );
|
||||
pUnkCtrl->lpVtbl->Release( pUnkCtrl );
|
||||
hb_retnint( ( long ) obj );
|
||||
|
||||
@@ -956,7 +966,7 @@ HB_FUNC( HB_AX_ATLAXGETCONTROL ) // HWND hWnd = handle of control container wind
|
||||
|
||||
if( pUnk )
|
||||
{
|
||||
pUnk->lpVtbl->QueryInterface( pUnk, &IID_IDispatch, ( void** ) (void*) &obj );
|
||||
pUnk->lpVtbl->QueryInterface( pUnk, HB_ID_REF( IID_IDispatch ), ( void** ) (void*) &obj );
|
||||
pUnk->lpVtbl->Release( pUnk );
|
||||
GetClientRect( hWnd, &rc );
|
||||
//MoveWindow( GetDlgItem( hParent, ( int ) id ), 0, 0, rc.right-rc.left, rc.bottom-rc.top, TRUE );
|
||||
@@ -1000,7 +1010,7 @@ HB_FUNC( HB_AX_ATLSETVERB )
|
||||
IUnknown *pUnk = ( IUnknown* ) ( HB_PTRDIFF ) hb_parnint( 2 );
|
||||
|
||||
IOleObject *lpOleObject = NULL;
|
||||
if( SUCCEEDED( pUnk->lpVtbl->QueryInterface( pUnk, &IID_IOleObject, ( void** ) &lpOleObject ) ) )
|
||||
if( SUCCEEDED( pUnk->lpVtbl->QueryInterface( pUnk, HB_ID_REF( IID_IOleObject ), ( void** ) ( void* ) &lpOleObject ) ) )
|
||||
{
|
||||
IOleClientSite* lpOleClientSite;
|
||||
|
||||
|
||||
@@ -76,8 +76,6 @@
|
||||
|
||||
#define HB_OS_WIN_USED
|
||||
|
||||
#define NONAMELESSUNION
|
||||
|
||||
#include "gtwvg.h"
|
||||
#include "hbwapi.h"
|
||||
#include <windowsx.h>
|
||||
|
||||
@@ -446,6 +446,18 @@ char * hb_verCompiler( void )
|
||||
iVerMinor = __ICL % 100;
|
||||
iVerPatch = 0;
|
||||
|
||||
#elif defined(__ICC)
|
||||
|
||||
pszName = "Intel(R) (ICC) C";
|
||||
|
||||
#if defined(__cplusplus)
|
||||
hb_strncpy( szSub, "++", sizeof( szSub ) - 1 );
|
||||
#endif
|
||||
|
||||
iVerMajor = __ICC / 100;
|
||||
iVerMinor = __ICC % 100;
|
||||
iVerPatch = 0;
|
||||
|
||||
#elif defined(_MSC_VER)
|
||||
|
||||
#if (_MSC_VER >= 800)
|
||||
|
||||
@@ -620,7 +620,7 @@ HB_FUNC( HB_DISPOUTATBOX )
|
||||
else if( ISNUM( 4 ) )
|
||||
iColor = hb_parni( 4 );
|
||||
else
|
||||
iColor = -1;
|
||||
iColor = hb_gtGetCurrColor();
|
||||
|
||||
while( nStringLen-- )
|
||||
hb_gtPutChar( nRow, nCol++, ( BYTE ) iColor, HB_GT_ATTR_BOX, ( USHORT ) *pszString++ );
|
||||
|
||||
@@ -1492,7 +1492,7 @@ BOOL hb_threadMutexUnlock( PHB_ITEM pItem )
|
||||
if( pMutex )
|
||||
{
|
||||
#if !defined( HB_MT_VM )
|
||||
if( HB_THREAD_EQUAL( pMutex->owner, HB_THREAD_SELF() ) )
|
||||
if( pMutex->lock_count )
|
||||
{
|
||||
if( --pMutex->lock_count == 0 )
|
||||
pMutex->owner = ( HB_THREAD_ID ) 0;
|
||||
@@ -1523,6 +1523,11 @@ BOOL hb_threadMutexLock( PHB_ITEM pItem )
|
||||
|
||||
if( pMutex )
|
||||
{
|
||||
#if !defined( HB_MT_VM )
|
||||
pMutex->lock_count++;
|
||||
pMutex->owner = ( HB_THREAD_ID ) 1;
|
||||
fResult = TRUE;
|
||||
#else
|
||||
if( HB_THREAD_EQUAL( pMutex->owner, HB_THREAD_SELF() ) )
|
||||
{
|
||||
pMutex->lock_count++;
|
||||
@@ -1532,11 +1537,6 @@ BOOL hb_threadMutexLock( PHB_ITEM pItem )
|
||||
{
|
||||
hb_vmUnlock();
|
||||
|
||||
#if !defined( HB_MT_VM )
|
||||
pMutex->lock_count = 1;
|
||||
pMutex->owner = HB_THREAD_SELF();
|
||||
fResult = TRUE;
|
||||
#else
|
||||
HB_CRITICAL_LOCK( pMutex->mutex );
|
||||
while( pMutex->lock_count != 0 )
|
||||
{
|
||||
@@ -1556,9 +1556,10 @@ BOOL hb_threadMutexLock( PHB_ITEM pItem )
|
||||
pMutex->owner = HB_THREAD_SELF();
|
||||
HB_CRITICAL_UNLOCK( pMutex->mutex );
|
||||
fResult = TRUE;
|
||||
#endif
|
||||
|
||||
hb_vmLock();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
return fResult;
|
||||
}
|
||||
@@ -1570,6 +1571,12 @@ BOOL hb_threadMutexTimedLock( PHB_ITEM pItem, ULONG ulMilliSec )
|
||||
|
||||
if( pMutex )
|
||||
{
|
||||
#if !defined( HB_MT_VM )
|
||||
HB_SYMBOL_UNUSED( ulMilliSec );
|
||||
pMutex->lock_count++;
|
||||
pMutex->owner = ( HB_THREAD_ID ) 1;
|
||||
fResult = TRUE;
|
||||
#else
|
||||
if( HB_THREAD_EQUAL( pMutex->owner, HB_THREAD_SELF() ) )
|
||||
{
|
||||
pMutex->lock_count++;
|
||||
@@ -1579,12 +1586,6 @@ BOOL hb_threadMutexTimedLock( PHB_ITEM pItem, ULONG ulMilliSec )
|
||||
{
|
||||
hb_vmUnlock();
|
||||
|
||||
#if !defined( HB_MT_VM )
|
||||
HB_SYMBOL_UNUSED( ulMilliSec );
|
||||
pMutex->lock_count = 1;
|
||||
pMutex->owner = HB_THREAD_SELF();
|
||||
fResult = TRUE;
|
||||
#else
|
||||
HB_CRITICAL_LOCK( pMutex->mutex );
|
||||
if( ulMilliSec && pMutex->lock_count != 0 )
|
||||
{
|
||||
@@ -1630,10 +1631,10 @@ BOOL hb_threadMutexTimedLock( PHB_ITEM pItem, ULONG ulMilliSec )
|
||||
fResult = TRUE;
|
||||
}
|
||||
HB_CRITICAL_UNLOCK( pMutex->mutex );
|
||||
#endif
|
||||
|
||||
hb_vmLock();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
return fResult;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user