2010-05-28 18:51 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)

* contrib/hbmisc/calldll.prg
    ! Fixed to use Windows system .dll calling convention
      (stdcall) by default, to emulate original function's
      behavior. Note that on non-Windows systems, calling 
      convention will be set to the default (cdecl).

  * contrib/hbmisc/tests/testcall.prg
    * Replace examples with a Windows system .dll call.
This commit is contained in:
Viktor Szakats
2010-05-28 16:51:23 +00:00
parent bcceab5af4
commit f847912e0d
3 changed files with 22 additions and 10 deletions

View File

@@ -17,6 +17,16 @@
past entries belonging to author(s): Viktor Szakats.
*/
2010-05-28 18:51 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
* contrib/hbmisc/calldll.prg
! Fixed to use Windows system .dll calling convention
(stdcall) by default, to emulate original function's
behavior. Note that on non-Windows systems, calling
convention will be set to the default (cdecl).
* contrib/hbmisc/tests/testcall.prg
* Replace examples with a Windows system .dll call.
2010-05-28 18:28 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
* utils/hbmk2/hbmk2.prg
+ Added untested, experimental support for -reqpkg=/reqpkgs=

View File

@@ -63,7 +63,14 @@ PROCEDURE UNLOADALLDLL()
FUNCTION CALLDLL32( cFunction, cLibrary, ... )
RETURN HB_DYNACALL1( cFunction, cLibrary, NIL, ... )
#define _DEF_CALLCONV_ HB_DYN_CTYPE_CHAR_PTR
#if define( __PLATFORM__WINDOWS )
/* Use Windows system .dll calling convention on Windows systems,
like in original lib. Original .lib was a Windows-only solution.
[vszakats] */
#define _DEF_CALLCONV_ HB_DYN_CALLCONV_STDCALL
#else
#define _DEF_CALLCONV_ HB_DYN_CALLCONV_CDECL
#endif
FUNCTION HB_DYNACALL1( cFunction, cLibrary, nCount, ... )
LOCAL aParams

View File

@@ -11,15 +11,10 @@
*/
PROCEDURE Main()
LOCAL nFlags
? CALLDLL32( "curl_version", "libcurl.dll" )
? CALLDLL32( "SSLeay_version", "libeay32.dll", 0 )
? CALLDLL32( "SSLeay_version", "libeay32.dll", 1 )
? CALLDLL32( "SSLeay_version", "libeay32.dll", 2 )
? CALLDLL32( "SSLeay_version", "libeay32.dll", 3 )
? CALLDLL32( "SSLeay_version", "libeay32.dll", 4 )
? HB_DYNACALL1( "SSLeay_version", "libeay32.dll", 0, 4 )
nFlags := -1
? CALLDLL32( "InternetGetConnectedState", "wininet.dll", @nFlags, 0 )
? nFlags
RETURN