2008-12-24 12:00 UTC+0700 Andi Jahja <xharbour/AT/telkom/net/id>
* include/hbdefs.h
* disabling HB_FORCE_EXPORT in MinGW builds breaks applications using
pCode DLL with standard build because the DLL can no longer see the
required function in the executable. Compiling xHarbour with -D__EXPORT__
will do the job, but that's not the point.
As a note, functions which are "forced-export" are those required by
source/vm/maindllp.c, so pCode DLL users is facilitated by then.
The sample below fails due to nulling the qualifier:
///// BEGIN Application Code
PROCEDURE MAIN()
? FOO()
///// END Application Code
///// BEGIN DLL Codes
typedef void (*HB_RETC)( const char * szText );
HB_FUNC( FOO ) { my_retc( "FOO" ); }
void my_retc( const char * szText )
{
// Looking "_hb_retc" in EXECUTABLE which is no longer accessible
// due to nulling of HB_FORCE_EXPORT. In my Windows machine, MINGW
// (and others too) cannot work with HB_FORCE_EXPORT nulled.
HB_RETC pRetc = GetProcAddress( GetModuleHandle( NULL ), "_hb_retc" );
pRetc ( szText );
}
///// END DLL Codes
Because of this, the disabling of HB_FORCE_EXPORT is now guarded by
a define constant "NO_DISABLE_FORCE_EXPORT", hence those who want
MINGW apps works as before should add this define to disable the hack.
--
Andi
------------------------------------------------------------------------------
_______________________________________________
xHarbour-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xharbour-developers