From 385644d7fb7728c0c7a36a73d4f46a145fb834c1 Mon Sep 17 00:00:00 2001 From: Przemyslaw Czerpak Date: Mon, 7 Sep 2009 20:30:06 +0000 Subject: [PATCH] 2009-09-07 22:29 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/source/vm/thread.c + added HB_MT() PRG function which exists only in MT HVM version and can be REQUESTed from .prg code to force linking MT HVM. * harbour/contrib/hbnetio/utils/netiosrv.prg ! fixed typo in port parameter support * modified name of second parameter. Instead of 'address' use 'ifaddr' (interface address) which seems to be more precise name. * added 'request HB_MT' to protect linking with HVM without MT support. --- harbour/ChangeLog | 11 +++++++++++ harbour/contrib/hbnetio/utils/netiosrv.prg | 7 +++++-- harbour/source/vm/thread.c | 7 +++++++ 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index b0c82a4624..d271db4be4 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,17 @@ past entries belonging to author(s): Viktor Szakats. */ +2009-09-07 22:29 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) + * harbour/source/vm/thread.c + + added HB_MT() PRG function which exists only in MT HVM version and + can be REQUESTed from .prg code to force linking MT HVM. + + * harbour/contrib/hbnetio/utils/netiosrv.prg + ! fixed typo in port parameter support + * modified name of second parameter. Instead of 'address' use 'ifaddr' + (interface address) which seems to be more precise name. + * added 'request HB_MT' to protect linking with HVM without MT support. + 2009-09-07 21:21 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * config/common/watcom.mk ! Upped -p linker option (from 64 to 72) to not choke on hbrtl diff --git a/harbour/contrib/hbnetio/utils/netiosrv.prg b/harbour/contrib/hbnetio/utils/netiosrv.prg index fd7900942c..2cb3e137d2 100644 --- a/harbour/contrib/hbnetio/utils/netiosrv.prg +++ b/harbour/contrib/hbnetio/utils/netiosrv.prg @@ -12,10 +12,13 @@ * */ -proc main( cPort, cAddress ) +/* netio_mtserver() needs MT HVM version */ +request HB_MT + +proc main( port, ifaddr ) local pListenSocket - pListenSocket := netio_mtserver( hb_ntos( cPort ), cAddress ) + pListenSocket := netio_mtserver( iif( port != NIL, val( port ), ), ifaddr ) if empty( pListenSocket ) ? "Cannot start server." else diff --git a/harbour/source/vm/thread.c b/harbour/source/vm/thread.c index 660a652c7a..c813afc867 100644 --- a/harbour/source/vm/thread.c +++ b/harbour/source/vm/thread.c @@ -2506,6 +2506,13 @@ HB_FUNC( HB_MTVM ) #endif } +#if defined( HB_MT_VM ) +HB_FUNC( HB_MT ) +{ + hb_retl( TRUE ); +} +#endif + #if defined( HB_TASK_THREAD ) && defined( HB_MT_VM ) # include "task.c" #endif